@boomerang-io/carbon-addons-boomerang-react 4.6.14-beta.9 → 4.6.15-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -162
- package/dist/cjs/components/AboutPlatform/AboutPlatform.js +50 -50
- package/dist/cjs/components/AdvantageSideNav/AdvantageSideNav.js +221 -221
- package/dist/cjs/components/AutoSuggest/AutoSuggest.js +101 -101
- package/dist/cjs/components/Avatar/Avatar.js +18 -18
- package/dist/cjs/components/CheckboxList/CheckboxList.js +34 -34
- package/dist/cjs/components/ComboBox/ComboBox.js +103 -103
- package/dist/cjs/components/ComboBoxMultiSelect/ComboBoxMultiSelect.js +32 -32
- package/dist/cjs/components/ComboBoxMultiSelect/MultiSelect.js +208 -208
- package/dist/cjs/components/ComposedModal/ComposedModal.js +80 -80
- package/dist/cjs/components/ConfirmModal/ConfirmModal.js +43 -43
- package/dist/cjs/components/Creatable/Creatable.js +137 -137
- package/dist/cjs/components/DataDrivenInput/DataDrivenInput.js +226 -226
- package/dist/cjs/components/DateInput/DateInput.js +35 -35
- package/dist/cjs/components/DecisionButtons/DecisionButtons.js +61 -61
- package/dist/cjs/components/DelayedRender/DelayedRender.js +17 -17
- package/dist/cjs/components/DynamicFormik/DynamicFormik.js +578 -578
- package/dist/cjs/components/Error403/Error403.js +13 -13
- package/dist/cjs/components/Error403/ForbiddenErrorBackground.js +113 -113
- package/dist/cjs/components/Error403/GraphicWrangler/GraphicWrangler.js +62 -62
- package/dist/cjs/components/Error404/Error404.js +13 -13
- package/dist/cjs/components/Error404/GraphicLoch/GraphicLoch.js +17 -17
- package/dist/cjs/components/Error404/NotFoundErrorBackground.js +129 -129
- package/dist/cjs/components/ErrorBoundary/ErrorBoundary.js +32 -32
- package/dist/cjs/components/ErrorDragon/ErrorDragon.js +13 -13
- package/dist/cjs/components/ErrorDragon/assets/ErrorGraphic.js +35 -35
- package/dist/cjs/components/ErrorFullPage/ErrorFullPage.js +10 -10
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +22 -22
- package/dist/cjs/components/ErrorPage/ErrorPage.js +11 -11
- package/dist/cjs/components/ErrorPageCore/ErrorPageCore.js +15 -15
- package/dist/cjs/components/ErrorPageCore/GenericErrorBackground.js +124 -124
- package/dist/cjs/components/FeatureHeader/FeatureHeader.js +29 -29
- package/dist/cjs/components/FeatureNavTab/FeatureNavTab.js +12 -12
- package/dist/cjs/components/FeatureNavTabs/FeatureNavTabs.js +12 -12
- package/dist/cjs/components/FeatureSideNav/FeatureSideNav.js +12 -12
- package/dist/cjs/components/FeatureSideNav/FeatureSideNavFooter.js +8 -8
- package/dist/cjs/components/FeatureSideNav/FeatureSideNavHeader.js +8 -8
- package/dist/cjs/components/FeatureSideNav/FeatureSideNavLinks.js +14 -14
- package/dist/cjs/components/FeatureSideNavLink/FeatureSideNavLink.js +12 -12
- package/dist/cjs/components/Feedback/Feedback.js +38 -38
- package/dist/cjs/components/FlowModal/FlowModal.js +141 -141
- package/dist/cjs/components/FlowModal/FlowModalForm.js +12 -12
- package/dist/cjs/components/Header/Header.js +187 -187
- package/dist/cjs/components/Header/HeaderAppSwitcher.js +94 -94
- package/dist/cjs/components/Header/HeaderMenu.js +7 -7
- package/dist/cjs/components/Header/HeaderMenuItem.js +51 -51
- package/dist/cjs/components/Header/HeaderTeamSwitcher.js +329 -332
- package/dist/cjs/components/Header/UserRequests.js +29 -29
- package/dist/cjs/components/ImageModal/ImageModal.js +17 -17
- package/dist/cjs/components/Loading/Loading.js +8 -8
- package/dist/cjs/components/MemberBar/MemberBar.js +20 -20
- package/dist/cjs/components/Modal/Modal.js +20 -20
- package/dist/cjs/components/ModalConfirmEdit/ModalConfirmArray.js +14 -14
- package/dist/cjs/components/ModalConfirmEdit/ModalConfirmDetails.js +11 -11
- package/dist/cjs/components/ModalConfirmEdit/ModalConfirmEdit.js +17 -17
- package/dist/cjs/components/ModalForm/ModalForm.js +9 -9
- package/dist/cjs/components/Notifications/NotificationsContainer.js +22 -22
- package/dist/cjs/components/Notifications/ToastNotification.js +21 -21
- package/dist/cjs/components/Notifications/notify.js +17 -17
- package/dist/cjs/components/PlatformBanner/PlatformBanner.js +8 -8
- package/dist/cjs/components/PlatformNotifications/PlatformNotification.js +17 -17
- package/dist/cjs/components/PlatformNotifications/PlatformNotificationsContainer.js +136 -136
- package/dist/cjs/components/Portal/Portal.js +14 -14
- package/dist/cjs/components/PrivacyRedirect/PrivacyRedirect.js +30 -30
- package/dist/cjs/components/PrivacyStatement/PrivacyStatement.js +90 -90
- package/dist/cjs/components/ProfileSettings/ProfileSettings.js +124 -142
- package/dist/cjs/components/ProtectedRoute/ProtectedRoute.js +13 -13
- package/dist/cjs/components/RadioGroup/RadioGroup.js +33 -33
- package/dist/cjs/components/RichTextArea/RichTextArea.js +142 -142
- package/dist/cjs/components/SignOut/SignOut.js +27 -27
- package/dist/cjs/components/SupportCenter/SupportCenter.js +65 -65
- package/dist/cjs/components/TextArea/TextArea.js +16 -16
- package/dist/cjs/components/TextInput/TextInput.js +13 -13
- package/dist/cjs/components/Toggle/Toggle.js +22 -22
- package/dist/cjs/components/TooltipHover/TooltipHover.js +39 -39
- package/dist/cjs/components/UIShell/UIShell.js +95 -95
- package/dist/cjs/config/servicesConfig.js +22 -22
- package/dist/cjs/constants/DataDrivenInputTypes.js +74 -74
- package/dist/cjs/constants/UserType.js +13 -13
- package/dist/cjs/hooks/useHeaderMenu.js +49 -49
- package/dist/cjs/hooks/usePortal.js +74 -74
- package/dist/cjs/hooks/useWindowSize.js +33 -33
- package/dist/cjs/internal/ListBox/ListBox.js +41 -41
- package/dist/cjs/internal/ListBox/ListBoxField.js +19 -19
- package/dist/cjs/internal/ListBox/ListBoxMenu.js +19 -19
- package/dist/cjs/internal/ListBox/ListBoxMenuIcon.js +31 -31
- package/dist/cjs/internal/ListBox/ListBoxMenuItem.js +38 -38
- package/dist/cjs/internal/ListBox/ListBoxSelection.js +64 -64
- package/dist/cjs/internal/ListBox/index.js +10 -10
- package/dist/cjs/internal/keyboard/keys.js +16 -16
- package/dist/cjs/internal/keyboard/match.js +67 -67
- package/dist/cjs/internal/settings.js +5 -5
- package/dist/cjs/tools/accessibility.js +13 -13
- package/dist/cjs/tools/createPropAdapter.js +44 -44
- package/dist/cjs/tools/isUrl.js +39 -39
- package/dist/cjs/tools/setupGetInstanceId.js +20 -20
- package/dist/cjs/tools/useSetState.js +12 -12
- package/dist/cjs/tools/yupAst/astGenerator.js +212 -212
- package/dist/cjs/tools/yupAst/customValidators.js +17 -17
- package/dist/esm/components/AboutPlatform/AboutPlatform.js +50 -50
- package/dist/esm/components/AdvantageSideNav/AdvantageSideNav.js +221 -221
- package/dist/esm/components/AutoSuggest/AutoSuggest.js +101 -101
- package/dist/esm/components/Avatar/Avatar.js +18 -18
- package/dist/esm/components/CheckboxList/CheckboxList.js +34 -34
- package/dist/esm/components/ComboBox/ComboBox.js +103 -103
- package/dist/esm/components/ComboBoxMultiSelect/ComboBoxMultiSelect.js +32 -32
- package/dist/esm/components/ComboBoxMultiSelect/MultiSelect.js +208 -208
- package/dist/esm/components/ComposedModal/ComposedModal.js +80 -80
- package/dist/esm/components/ConfirmModal/ConfirmModal.js +43 -43
- package/dist/esm/components/Creatable/Creatable.js +137 -137
- package/dist/esm/components/DataDrivenInput/DataDrivenInput.js +226 -226
- package/dist/esm/components/DateInput/DateInput.js +35 -35
- package/dist/esm/components/DecisionButtons/DecisionButtons.js +61 -61
- package/dist/esm/components/DelayedRender/DelayedRender.js +17 -17
- package/dist/esm/components/DynamicFormik/DynamicFormik.js +578 -578
- package/dist/esm/components/Error403/Error403.js +13 -13
- package/dist/esm/components/Error403/ForbiddenErrorBackground.js +113 -113
- package/dist/esm/components/Error403/GraphicWrangler/GraphicWrangler.js +62 -62
- package/dist/esm/components/Error404/Error404.js +13 -13
- package/dist/esm/components/Error404/GraphicLoch/GraphicLoch.js +17 -17
- package/dist/esm/components/Error404/NotFoundErrorBackground.js +129 -129
- package/dist/esm/components/ErrorBoundary/ErrorBoundary.js +32 -32
- package/dist/esm/components/ErrorDragon/ErrorDragon.js +13 -13
- package/dist/esm/components/ErrorDragon/assets/ErrorGraphic.js +35 -35
- package/dist/esm/components/ErrorFullPage/ErrorFullPage.js +10 -10
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +22 -22
- package/dist/esm/components/ErrorPage/ErrorPage.js +11 -11
- package/dist/esm/components/ErrorPageCore/ErrorPageCore.js +15 -15
- package/dist/esm/components/ErrorPageCore/GenericErrorBackground.js +124 -124
- package/dist/esm/components/FeatureHeader/FeatureHeader.js +29 -29
- package/dist/esm/components/FeatureNavTab/FeatureNavTab.js +12 -12
- package/dist/esm/components/FeatureNavTabs/FeatureNavTabs.js +12 -12
- package/dist/esm/components/FeatureSideNav/FeatureSideNav.js +12 -12
- package/dist/esm/components/FeatureSideNav/FeatureSideNavFooter.js +8 -8
- package/dist/esm/components/FeatureSideNav/FeatureSideNavHeader.js +8 -8
- package/dist/esm/components/FeatureSideNav/FeatureSideNavLinks.js +14 -14
- package/dist/esm/components/FeatureSideNavLink/FeatureSideNavLink.js +12 -12
- package/dist/esm/components/Feedback/Feedback.js +38 -38
- package/dist/esm/components/FlowModal/FlowModal.js +141 -141
- package/dist/esm/components/FlowModal/FlowModalForm.js +12 -12
- package/dist/esm/components/Header/Header.js +187 -187
- package/dist/esm/components/Header/HeaderAppSwitcher.js +94 -94
- package/dist/esm/components/Header/HeaderMenu.js +7 -7
- package/dist/esm/components/Header/HeaderMenuItem.js +51 -51
- package/dist/esm/components/Header/HeaderTeamSwitcher.js +329 -332
- package/dist/esm/components/Header/UserRequests.js +29 -29
- package/dist/esm/components/ImageModal/ImageModal.js +17 -17
- package/dist/esm/components/Loading/Loading.js +8 -8
- package/dist/esm/components/MemberBar/MemberBar.js +20 -20
- package/dist/esm/components/Modal/Modal.js +20 -20
- package/dist/esm/components/ModalConfirmEdit/ModalConfirmArray.js +14 -14
- package/dist/esm/components/ModalConfirmEdit/ModalConfirmDetails.js +11 -11
- package/dist/esm/components/ModalConfirmEdit/ModalConfirmEdit.js +17 -17
- package/dist/esm/components/ModalForm/ModalForm.js +9 -9
- package/dist/esm/components/Notifications/NotificationsContainer.js +22 -22
- package/dist/esm/components/Notifications/ToastNotification.js +21 -21
- package/dist/esm/components/Notifications/notify.js +17 -17
- package/dist/esm/components/PlatformBanner/PlatformBanner.js +8 -8
- package/dist/esm/components/PlatformNotifications/PlatformNotification.js +17 -17
- package/dist/esm/components/PlatformNotifications/PlatformNotificationsContainer.js +136 -136
- package/dist/esm/components/Portal/Portal.js +14 -14
- package/dist/esm/components/PrivacyRedirect/PrivacyRedirect.js +30 -30
- package/dist/esm/components/PrivacyStatement/PrivacyStatement.js +90 -90
- package/dist/esm/components/ProfileSettings/ProfileSettings.js +124 -142
- package/dist/esm/components/ProtectedRoute/ProtectedRoute.js +13 -13
- package/dist/esm/components/RadioGroup/RadioGroup.js +33 -33
- package/dist/esm/components/RichTextArea/RichTextArea.js +142 -142
- package/dist/esm/components/SignOut/SignOut.js +27 -27
- package/dist/esm/components/SupportCenter/SupportCenter.js +65 -65
- package/dist/esm/components/TextArea/TextArea.js +16 -16
- package/dist/esm/components/TextInput/TextInput.js +13 -13
- package/dist/esm/components/Toggle/Toggle.js +22 -22
- package/dist/esm/components/TooltipHover/TooltipHover.js +39 -39
- package/dist/esm/components/UIShell/UIShell.js +95 -95
- package/dist/esm/config/servicesConfig.js +22 -22
- package/dist/esm/constants/DataDrivenInputTypes.js +74 -74
- package/dist/esm/constants/UserType.js +13 -13
- package/dist/esm/hooks/useHeaderMenu.js +49 -49
- package/dist/esm/hooks/usePortal.js +74 -74
- package/dist/esm/hooks/useWindowSize.js +33 -33
- package/dist/esm/internal/ListBox/ListBox.js +41 -41
- package/dist/esm/internal/ListBox/ListBoxField.js +19 -19
- package/dist/esm/internal/ListBox/ListBoxMenu.js +19 -19
- package/dist/esm/internal/ListBox/ListBoxMenuIcon.js +31 -31
- package/dist/esm/internal/ListBox/ListBoxMenuItem.js +38 -38
- package/dist/esm/internal/ListBox/ListBoxSelection.js +64 -64
- package/dist/esm/internal/ListBox/index.js +10 -10
- package/dist/esm/internal/keyboard/keys.js +16 -16
- package/dist/esm/internal/keyboard/match.js +67 -67
- package/dist/esm/internal/settings.js +5 -5
- package/dist/esm/tools/accessibility.js +13 -13
- package/dist/esm/tools/createPropAdapter.js +44 -44
- package/dist/esm/tools/isUrl.js +39 -39
- package/dist/esm/tools/setupGetInstanceId.js +20 -20
- package/dist/esm/tools/useSetState.js +12 -12
- package/dist/esm/tools/yupAst/astGenerator.js +212 -212
- package/dist/esm/tools/yupAst/customValidators.js +17 -17
- package/dist/types/index.d.ts +1359 -1360
- package/package.json +167 -167
- package/scss/components/AboutPlatform/_aboutPlatform.scss +139 -139
- package/scss/components/AdvantageSideNav/_advantageSideNav.scss +272 -272
- package/scss/components/AutoSuggest/_autoSuggest.scss +62 -62
- package/scss/components/Avatar/_avatar.scss +32 -32
- package/scss/components/CheckboxList/_checkboxList.scss +26 -26
- package/scss/components/ComboBox/_combobox.scss +23 -23
- package/scss/components/ComboBoxMultiSelect/_comboBoxMultiSelect.scss +53 -53
- package/scss/components/ConfirmModal/_confirmModal.scss +12 -12
- package/scss/components/Creatable/_creatable.scss +48 -48
- package/scss/components/DateInput/_dateInput.scss +36 -36
- package/scss/components/DecisionButtons/_decisionButtons.scss +132 -132
- package/scss/components/DynamicFormik/_dynamicFormik.scss +17 -17
- package/scss/components/ErrorBoundary/_errorBoundary.scss +12 -12
- package/scss/components/ErrorDragon/_errorDragon.scss +55 -55
- package/scss/components/ErrorMessage/_errorMessage.scss +43 -43
- package/scss/components/ErrorPage/_errorPage.scss +66 -66
- package/scss/components/ErrorPageCore/_errorPageCore.scss +73 -73
- package/scss/components/FeatureHeader/_featureHeader.scss +67 -67
- package/scss/components/FeatureNavTab/_featureNavTab.scss +27 -27
- package/scss/components/FeatureSideNav/_featureSideNav.scss +76 -76
- package/scss/components/FeatureSideNavLink/_featureSideNavLink.scss +49 -49
- package/scss/components/Feedback/_feedback.scss +50 -50
- package/scss/components/Header/_header.scss +179 -179
- package/scss/components/Header/_headerAppSwitcher.scss +117 -117
- package/scss/components/Header/_headerMenu.scss +30 -30
- package/scss/components/Header/_headerMenuItem.scss +65 -65
- package/scss/components/Header/_headerTeamSwitcher.scss +222 -222
- package/scss/components/Header/_userRequests.scss +36 -36
- package/scss/components/ImageModal/_imageModal.scss +51 -51
- package/scss/components/MemberBar/_memberBar.scss +99 -99
- package/scss/components/Modal/_modal.scss +163 -163
- package/scss/components/ModalConfirmEdit/_modalConfirmEdit.scss +113 -113
- package/scss/components/Notifications/_notifications.scss +57 -57
- package/scss/components/PlatformBanner/_platformBanner.scss +30 -30
- package/scss/components/PlatformNotifications/_platformNotifications.scss +230 -230
- package/scss/components/PrivacyRedirect/_privacyRedirect.scss +43 -43
- package/scss/components/PrivacyStatement/_privacyStatement.scss +137 -137
- package/scss/components/ProfileSettings/_profileSettings.scss +117 -117
- package/scss/components/ProtectedRoute/_protectedRoute.scss +32 -32
- package/scss/components/RadioGroup/_radioGroup.scss +46 -46
- package/scss/components/RichTextArea/_richTextArea.scss +82 -82
- package/scss/components/SignOut/_signOut.scss +51 -51
- package/scss/components/SupportCenter/_supportCenter.scss +16 -16
- package/scss/components/TextArea/_textArea.scss +19 -19
- package/scss/components/TextInput/_textInput.scss +26 -26
- package/scss/components/Toggle/_toggle.scss +80 -80
- package/scss/components/TooltipHover/_tooltip.scss +48 -48
- package/scss/global/_config.scss +14 -14
- package/scss/global/_tippy.scss +49 -49
- package/scss/global/index.scss +401 -401
- package/scss/global/themes/_boomerang.scss +184 -184
- package/scss/global/themes/_default.scss +79 -79
- package/scss/global/themes/_shell-tokens.scss +42 -42
- package/scss/global/utils/_animations.scss +15 -15
- package/scss/global/utils/_mixins.scss +67 -67
- package/scss/global/utils/index.scss +10 -10
|
@@ -3,45 +3,45 @@ import Tippy from '@tippyjs/react';
|
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { prefix } from '../../internal/settings.js';
|
|
5
5
|
|
|
6
|
-
/*
|
|
7
|
-
IBM Confidential
|
|
8
|
-
694970X, 69497O0
|
|
9
|
-
© Copyright IBM Corp. 2022, 2024
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* TooltipHover to replace TooltipDefintion in most situations.
|
|
13
|
-
* Uses https://github.com/atomiks/tippyjs-react
|
|
14
|
-
*/
|
|
15
|
-
function TooltipHover({ align, direction, children, className, content, placement, tooltipContent, tooltipText, ...rest }) {
|
|
16
|
-
// support all three for compat with both tippy props and carbon
|
|
17
|
-
const contentToRender = content || tooltipContent || tooltipText;
|
|
18
|
-
/**
|
|
19
|
-
* Determine where to place it based on possible combinations
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
let computedPlacement = "";
|
|
23
|
-
// Tippy prop placement takes precedence
|
|
24
|
-
if (placement) {
|
|
25
|
-
computedPlacement = placement;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
if (direction && align) {
|
|
29
|
-
computedPlacement = `${direction}-${align}`;
|
|
30
|
-
}
|
|
31
|
-
else if (direction) {
|
|
32
|
-
computedPlacement = direction;
|
|
33
|
-
}
|
|
34
|
-
else if (align) {
|
|
35
|
-
computedPlacement = `auto-${align}`;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
computedPlacement = "bottom";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Sensible defaults to match CDS
|
|
42
|
-
return (React.createElement(Tippy, { arrow: `<svg height="6px" width="8px" viewBox="0 0 80 60" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
-
<polygon points= "0 60, 40 0, 80 60"/>
|
|
44
|
-
</svg>`, animation: "fade", className: cx(`${prefix}--bmrg-tooltip`, className), content: contentToRender, duration: 100, placement: computedPlacement, ...rest }, children));
|
|
6
|
+
/*
|
|
7
|
+
IBM Confidential
|
|
8
|
+
694970X, 69497O0
|
|
9
|
+
© Copyright IBM Corp. 2022, 2024
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* TooltipHover to replace TooltipDefintion in most situations.
|
|
13
|
+
* Uses https://github.com/atomiks/tippyjs-react
|
|
14
|
+
*/
|
|
15
|
+
function TooltipHover({ align, direction, children, className, content, placement, tooltipContent, tooltipText, ...rest }) {
|
|
16
|
+
// support all three for compat with both tippy props and carbon
|
|
17
|
+
const contentToRender = content || tooltipContent || tooltipText;
|
|
18
|
+
/**
|
|
19
|
+
* Determine where to place it based on possible combinations
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
let computedPlacement = "";
|
|
23
|
+
// Tippy prop placement takes precedence
|
|
24
|
+
if (placement) {
|
|
25
|
+
computedPlacement = placement;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
if (direction && align) {
|
|
29
|
+
computedPlacement = `${direction}-${align}`;
|
|
30
|
+
}
|
|
31
|
+
else if (direction) {
|
|
32
|
+
computedPlacement = direction;
|
|
33
|
+
}
|
|
34
|
+
else if (align) {
|
|
35
|
+
computedPlacement = `auto-${align}`;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
computedPlacement = "bottom";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Sensible defaults to match CDS
|
|
42
|
+
return (React.createElement(Tippy, { arrow: `<svg height="6px" width="8px" viewBox="0 0 80 60" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
+
<polygon points= "0 60, 40 0, 80 60"/>
|
|
44
|
+
</svg>`, animation: "fade", className: cx(`${prefix}--bmrg-tooltip`, className), content: contentToRender, duration: 100, placement: computedPlacement, ...rest }, children));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export { TooltipHover as default };
|
|
@@ -13,101 +13,101 @@ import { queryClient } from '../../config/servicesConfig.js';
|
|
|
13
13
|
import { SignOutMenuItem } from '../SignOut/SignOut.js';
|
|
14
14
|
import { USER_PLATFORM_ROLE } from '../../constants/UserType.js';
|
|
15
15
|
|
|
16
|
-
/*
|
|
17
|
-
IBM Confidential
|
|
18
|
-
694970X, 69497O0
|
|
19
|
-
© Copyright IBM Corp. 2022, 2024
|
|
20
|
-
*/
|
|
21
|
-
function UIShell({ analyticsHelpers, baseEnvUrl, carbonTheme = "g10", config, createJoinTeamTrigger, history, isLaunchpad = false, isLoadingTeamSwitcher, isSuccessTeamSwitcher, setIsSuccessTeamSwitcher, leftPanel, platformName, productName, profileMenuItems = [], supportMenuItems = [], renderPrivacyRedirect = true, renderPrivacyStatement = true, rightPanel, handleShowTutorial, refetchUser,
|
|
22
|
-
// Support base header .e.g for an error state
|
|
23
|
-
if (!config) {
|
|
24
|
-
return (React.createElement(QueryClientProvider, { client: queryClient },
|
|
25
|
-
React.createElement(Header, { baseEnvUrl: baseEnvUrl ?? "", baseServicesUrl: "", carbonTheme: carbonTheme, enableAppSwitcher: false, enableNotifications: false, enableNotificationsCount: false, productName: productName || platformName || "", user: user })));
|
|
26
|
-
}
|
|
27
|
-
const { features, navigation, platform, platformMessage } = config;
|
|
28
|
-
const names = getProductAndPlatformNames({ productName, platformName, platform });
|
|
29
|
-
const sendIdeasUrl = platform?.feedbackUrl || "https://ideas.ibm.com";
|
|
30
|
-
const supportLink = platform?.supportUrl;
|
|
31
|
-
const sendBluePointsAwardUrl = platform?.sendBluePointsAwardUrl;
|
|
32
|
-
const partnerEmailId = "ica-support@ibm.com";
|
|
33
|
-
/**
|
|
34
|
-
* Check feature enablement via explicit feature flags
|
|
35
|
-
*/
|
|
36
|
-
const isAppSwitcherEnabled = Boolean(features?.["appSwitcher.enabled"]);
|
|
37
|
-
const instanceSwitcherEnabled = Boolean(platform?.["instanceSwitcherEnabled"]);
|
|
38
|
-
const isFeedbackEnabled = Boolean(features?.["feedback.enabled"]);
|
|
39
|
-
const isNotificationsEnabled = Boolean(features?.["notifications.enabled"]);
|
|
40
|
-
const isNotificationsCountEnabled = Boolean(features?.["notificationsCount.enabled"]);
|
|
41
|
-
const isSupportEnabled = Boolean(features?.["support.enabled"]);
|
|
42
|
-
/**
|
|
43
|
-
* Check feature enablement via value truthiness
|
|
44
|
-
*/
|
|
45
|
-
const isAboutPlatformEnabled = Boolean(platform.name);
|
|
46
|
-
const isCommunityEnabled = Boolean(platform?.communityUrl);
|
|
47
|
-
const isSendMailEnabled = Boolean(platform.sendMail);
|
|
48
|
-
const isSignOutEnabled = Boolean(platform?.signOutUrl);
|
|
49
|
-
const isUserEnabled = Boolean(user?.id);
|
|
50
|
-
const isPartnerUser = Boolean(user?.type === USER_PLATFORM_ROLE.Partner);
|
|
51
|
-
const supportFlagCheck = user?.showSupport;
|
|
52
|
-
const askICAEnabled = Boolean(platform?.askICAEnabled);
|
|
53
|
-
/**
|
|
54
|
-
* Checking for conditions when we explicitly set "renderPrivacyRedirect" to false (it defaults to true) OR
|
|
55
|
-
* it's disabled overall for the platform. This lets us toggle the UIShell consent redirect per app as needed
|
|
56
|
-
* e.g. disabled in Launchpad, but have it enabled for rest of the platform AND also support
|
|
57
|
-
* having it disabled in a "standalone" mode via the consent.enable feature flag, i.e. data driven via the service
|
|
58
|
-
*/
|
|
59
|
-
const isPrivacyRedirectDisabled = renderPrivacyRedirect === false || features?.["consent.enabled"] === false;
|
|
60
|
-
const isPrivacyModalRendered = isPrivacyRedirectDisabled === false && user?.hasConsented === false;
|
|
61
|
-
/**
|
|
62
|
-
* Also enable/disable privacy statement via the consent.enabled feature flag
|
|
63
|
-
*/
|
|
64
|
-
const isPrivacyStatementDisabled = renderPrivacyStatement === false || features?.["consent.enabled"] === false;
|
|
65
|
-
return (React.createElement(QueryClientProvider, { client: queryClient },
|
|
66
|
-
React.createElement(Header, { analyticsHelpers: analyticsHelpers, baseEnvUrl: platform.baseEnvUrl, baseServicesUrl: platform.baseServicesUrl, carbonTheme: carbonTheme, createJoinTeamTrigger: createJoinTeamTrigger, enableAppSwitcher: isAppSwitcherEnabled, instanceSwitcherEnabled: instanceSwitcherEnabled, enableNotifications: isNotificationsEnabled, enableNotificationsCount: isNotificationsCountEnabled, leftPanel: leftPanel, navLinks: navigation, platform: platform, platformMessage: platformMessage, prefixName: names.platformName, productName: names.productName, rightPanel: rightPanel, requestSummary: user?.requestSummary, skipToContentProps: skipToContentProps, templateMeteringEvent: templateMeteringEvent, triggerEvent: triggerEvent, profileMenuItems: [
|
|
67
|
-
isUserEnabled && (React.createElement(ProfileSettingsMenuItem, { key: "profile-settings", baseServicesUrl: platform.baseServicesUrl, src: `${platform.baseServicesUrl}/users/image/${user?.email}`, userName: user?.displayName ?? user?.name
|
|
68
|
-
isSendMailEnabled && (React.createElement(HeaderMenuItem, { key: "email-preferences", href: `${platform.baseEnvUrl}/launchpad/email-preferences`, icon: React.createElement(Email, null), kind: "internal", text: "Email Preferences", type: "link" })),
|
|
69
|
-
!isPrivacyStatementDisabled && (React.createElement(PrivacyStatementMenuItem, { key: "privacy-statement", baseServicesUrl: platform.baseServicesUrl, platformEmail: platform?.platformEmail })),
|
|
70
|
-
...profileMenuItems,
|
|
71
|
-
isSignOutEnabled && React.createElement(SignOutMenuItem, { key: "Sign Out", signOutLink: platform.signOutUrl }),
|
|
72
|
-
].filter(Boolean), supportMenuItems: [
|
|
73
|
-
!isPartnerUser && (React.createElement(HeaderMenuItem, { key: "docs", href: platform?.docs?.url, icon: React.createElement(Document, null), "data-testid": "docs", kind: "external", text: "Docs", type: "link" })),
|
|
74
|
-
isSupportEnabled &&
|
|
75
|
-
(supportFlagCheck || isPartnerUser ? (React.createElement(SupportCenterMenuItem, { key: "support-center", platformName: platform?.platformName, platformOrganization: platform?.platformOrganization, supportLink: supportLink, partnerEmailId: partnerEmailId, enablePartner: isPartnerUser, baseServicesUrl: platform.baseServicesUrl })) : (React.createElement(HeaderMenuItem, { key: "support-center", href: platform?.supportUrl, icon: React.createElement(HelpDesk, null), kind: "external", text: "Support Center", type: "link" }))),
|
|
76
|
-
React.createElement(HeaderMenuItem, { key: "release-notes", href: platform?.releaseNotesUrl, icon: React.createElement(CatalogPublish, null), "data-testid": "release-notes", kind: "app", text: "Release Notes", type: "link" }),
|
|
77
|
-
React.createElement(HeaderMenuItem, { key: "legal-terms", href: platform?.legalTermsUrl, icon: React.createElement(Policy, null), "data-testid": "legal-terms", kind: "app", text: "Legal Terms", type: "link" }),
|
|
78
|
-
React.createElement("span", { style: { borderBottom: "1px solid #b8c1c1" } }),
|
|
79
|
-
isCommunityEnabled && (React.createElement(HeaderMenuItem, { key: "community", href: platform?.communityUrl, icon: React.createElement(Forum, null), kind: "external", text: "Community", type: "link" })),
|
|
80
|
-
isFeedbackEnabled && (React.createElement(FeedbackMenuItem, { key: "feedback", platformName: platform?.platformName, platformOrganization: platform?.platformOrganization, sendIdeasUrl: sendIdeasUrl, sendBluePointsAwardUrl: sendBluePointsAwardUrl })),
|
|
81
|
-
!isPartnerUser && askICAEnabled ? (React.createElement(HeaderMenuItem, { key: "chat-launch", href: platform?.askICAUrl, icon: React.createElement(ChatLaunch, null), "data-testid": "askICA-chatlaunch", kind: "external", text: "AskICA", type: "link" })) : null,
|
|
82
|
-
!isPartnerUser && enableIcaMacs && (React.createElement(HeaderMenuItem, { key: "launch-ideation-agent", href: `${platform.baseEnvUrl}/launchpad/macs`, icon: React.createElement(Cognitive, null), "data-testid": "launch-ideation-agent", kind: "app", text: "AI Proposal Feedback Tool", type: "link" })),
|
|
83
|
-
isAboutPlatformEnabled && (React.createElement(AboutPlatformMenuItem, { key: "about-platform", name: platform.name, baseServicesUrl: platform.baseServicesUrl })),
|
|
84
|
-
tutorialScreenToShow && handleShowTutorial && (React.createElement(HeaderMenuItem, { key: "launch-tutorial", onClick: handleShowTutorial, icon: React.createElement(Book, null), "data-testid": "launch-tutorial", text: "Launch Tutorial", type: "button" })),
|
|
85
|
-
...supportMenuItems,
|
|
86
|
-
].filter(Boolean), history: history, isLaunchpad: isLaunchpad, isLoadingTeamSwitcher: isLoadingTeamSwitcher, isSuccessTeamSwitcher: isSuccessTeamSwitcher, refetchUser: refetchUser, refetchNavigation: refetchNavigation, setIsSuccessTeamSwitcher: setIsSuccessTeamSwitcher, trackEvent: trackEvent, user: user, userTeams: userTeams, userTeamsAssets: userTeamsAssets }),
|
|
87
|
-
isPrivacyModalRendered ? (React.createElement(PrivacyRedirect, { isOpen: true, baseEnvUrl: platform.baseEnvUrl, platformName: platform?.name, user: user })) : null));
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Determine how to render the name and prefix in the Header based
|
|
91
|
-
* on what is passed in. If we only have the plaform or product name, then
|
|
92
|
-
* we want it to be bolded. If we have both, then make the platform the prefix
|
|
93
|
-
*/
|
|
94
|
-
function getProductAndPlatformNames(args) {
|
|
95
|
-
const { productName, platformName, platform } = args;
|
|
96
|
-
const resolvedPlatformName = platform.platformName ?? platformName;
|
|
97
|
-
let finalProductName = "";
|
|
98
|
-
let finalPlatformName = "";
|
|
99
|
-
if (productName && resolvedPlatformName) {
|
|
100
|
-
finalProductName = productName;
|
|
101
|
-
finalPlatformName = resolvedPlatformName;
|
|
102
|
-
}
|
|
103
|
-
else if (productName && !resolvedPlatformName) {
|
|
104
|
-
finalProductName = productName;
|
|
105
|
-
}
|
|
106
|
-
else if (!productName && resolvedPlatformName) {
|
|
107
|
-
finalProductName = resolvedPlatformName;
|
|
108
|
-
}
|
|
109
|
-
else ;
|
|
110
|
-
return { productName: finalProductName, platformName: finalPlatformName };
|
|
16
|
+
/*
|
|
17
|
+
IBM Confidential
|
|
18
|
+
694970X, 69497O0
|
|
19
|
+
© Copyright IBM Corp. 2022, 2024
|
|
20
|
+
*/
|
|
21
|
+
function UIShell({ analyticsHelpers, baseEnvUrl, carbonTheme = "g10", config, createJoinTeamTrigger, history, isLaunchpad = false, isLoadingTeamSwitcher, isSuccessTeamSwitcher, setIsSuccessTeamSwitcher, leftPanel, platformName, productName, profileMenuItems = [], supportMenuItems = [], renderPrivacyRedirect = true, renderPrivacyStatement = true, rightPanel, handleShowTutorial, refetchUser, refetchNavigation, skipToContentProps, templateMeteringEvent, trackEvent, triggerEvent, tutorialScreenToShow, user, userTeams, userTeamsAssets, enableIcaMacs, }) {
|
|
22
|
+
// Support base header .e.g for an error state
|
|
23
|
+
if (!config) {
|
|
24
|
+
return (React.createElement(QueryClientProvider, { client: queryClient },
|
|
25
|
+
React.createElement(Header, { baseEnvUrl: baseEnvUrl ?? "", baseServicesUrl: "", carbonTheme: carbonTheme, enableAppSwitcher: false, enableNotifications: false, enableNotificationsCount: false, productName: productName || platformName || "", user: user })));
|
|
26
|
+
}
|
|
27
|
+
const { features, navigation, platform, platformMessage } = config;
|
|
28
|
+
const names = getProductAndPlatformNames({ productName, platformName, platform });
|
|
29
|
+
const sendIdeasUrl = platform?.feedbackUrl || "https://ideas.ibm.com";
|
|
30
|
+
const supportLink = platform?.supportUrl;
|
|
31
|
+
const sendBluePointsAwardUrl = platform?.sendBluePointsAwardUrl;
|
|
32
|
+
const partnerEmailId = "ica-support@ibm.com";
|
|
33
|
+
/**
|
|
34
|
+
* Check feature enablement via explicit feature flags
|
|
35
|
+
*/
|
|
36
|
+
const isAppSwitcherEnabled = Boolean(features?.["appSwitcher.enabled"]);
|
|
37
|
+
const instanceSwitcherEnabled = Boolean(platform?.["instanceSwitcherEnabled"]);
|
|
38
|
+
const isFeedbackEnabled = Boolean(features?.["feedback.enabled"]);
|
|
39
|
+
const isNotificationsEnabled = Boolean(features?.["notifications.enabled"]);
|
|
40
|
+
const isNotificationsCountEnabled = Boolean(features?.["notificationsCount.enabled"]);
|
|
41
|
+
const isSupportEnabled = Boolean(features?.["support.enabled"]);
|
|
42
|
+
/**
|
|
43
|
+
* Check feature enablement via value truthiness
|
|
44
|
+
*/
|
|
45
|
+
const isAboutPlatformEnabled = Boolean(platform.name);
|
|
46
|
+
const isCommunityEnabled = Boolean(platform?.communityUrl);
|
|
47
|
+
const isSendMailEnabled = Boolean(platform.sendMail);
|
|
48
|
+
const isSignOutEnabled = Boolean(platform?.signOutUrl);
|
|
49
|
+
const isUserEnabled = Boolean(user?.id);
|
|
50
|
+
const isPartnerUser = Boolean(user?.type === USER_PLATFORM_ROLE.Partner);
|
|
51
|
+
const supportFlagCheck = user?.showSupport;
|
|
52
|
+
const askICAEnabled = Boolean(platform?.askICAEnabled);
|
|
53
|
+
/**
|
|
54
|
+
* Checking for conditions when we explicitly set "renderPrivacyRedirect" to false (it defaults to true) OR
|
|
55
|
+
* it's disabled overall for the platform. This lets us toggle the UIShell consent redirect per app as needed
|
|
56
|
+
* e.g. disabled in Launchpad, but have it enabled for rest of the platform AND also support
|
|
57
|
+
* having it disabled in a "standalone" mode via the consent.enable feature flag, i.e. data driven via the service
|
|
58
|
+
*/
|
|
59
|
+
const isPrivacyRedirectDisabled = renderPrivacyRedirect === false || features?.["consent.enabled"] === false;
|
|
60
|
+
const isPrivacyModalRendered = isPrivacyRedirectDisabled === false && user?.hasConsented === false;
|
|
61
|
+
/**
|
|
62
|
+
* Also enable/disable privacy statement via the consent.enabled feature flag
|
|
63
|
+
*/
|
|
64
|
+
const isPrivacyStatementDisabled = renderPrivacyStatement === false || features?.["consent.enabled"] === false;
|
|
65
|
+
return (React.createElement(QueryClientProvider, { client: queryClient },
|
|
66
|
+
React.createElement(Header, { analyticsHelpers: analyticsHelpers, baseEnvUrl: platform.baseEnvUrl, baseServicesUrl: platform.baseServicesUrl, carbonTheme: carbonTheme, createJoinTeamTrigger: createJoinTeamTrigger, enableAppSwitcher: isAppSwitcherEnabled, instanceSwitcherEnabled: instanceSwitcherEnabled, enableNotifications: isNotificationsEnabled, enableNotificationsCount: isNotificationsCountEnabled, leftPanel: leftPanel, navLinks: navigation, platform: platform, platformMessage: platformMessage, prefixName: names.platformName, productName: names.productName, rightPanel: rightPanel, requestSummary: user?.requestSummary, skipToContentProps: skipToContentProps, templateMeteringEvent: templateMeteringEvent, triggerEvent: triggerEvent, profileMenuItems: [
|
|
67
|
+
isUserEnabled && (React.createElement(ProfileSettingsMenuItem, { key: "profile-settings", baseServicesUrl: platform.baseServicesUrl, src: `${platform.baseServicesUrl}/users/image/${user?.email}`, userName: user?.displayName ?? user?.name })),
|
|
68
|
+
isSendMailEnabled && (React.createElement(HeaderMenuItem, { key: "email-preferences", href: `${platform.baseEnvUrl}/launchpad/email-preferences`, icon: React.createElement(Email, null), kind: "internal", text: "Email Preferences", type: "link" })),
|
|
69
|
+
!isPrivacyStatementDisabled && (React.createElement(PrivacyStatementMenuItem, { key: "privacy-statement", baseServicesUrl: platform.baseServicesUrl, platformEmail: platform?.platformEmail })),
|
|
70
|
+
...profileMenuItems,
|
|
71
|
+
isSignOutEnabled && React.createElement(SignOutMenuItem, { key: "Sign Out", signOutLink: platform.signOutUrl }),
|
|
72
|
+
].filter(Boolean), supportMenuItems: [
|
|
73
|
+
!isPartnerUser && (React.createElement(HeaderMenuItem, { key: "docs", href: platform?.docs?.url, icon: React.createElement(Document, null), "data-testid": "docs", kind: "external", text: "Docs", type: "link" })),
|
|
74
|
+
isSupportEnabled &&
|
|
75
|
+
(supportFlagCheck || isPartnerUser ? (React.createElement(SupportCenterMenuItem, { key: "support-center", platformName: platform?.platformName, platformOrganization: platform?.platformOrganization, supportLink: supportLink, partnerEmailId: partnerEmailId, enablePartner: isPartnerUser, baseServicesUrl: platform.baseServicesUrl })) : (React.createElement(HeaderMenuItem, { key: "support-center", href: platform?.supportUrl, icon: React.createElement(HelpDesk, null), kind: "external", text: "Support Center", type: "link" }))),
|
|
76
|
+
React.createElement(HeaderMenuItem, { key: "release-notes", href: platform?.releaseNotesUrl, icon: React.createElement(CatalogPublish, null), "data-testid": "release-notes", kind: "app", text: "Release Notes", type: "link" }),
|
|
77
|
+
React.createElement(HeaderMenuItem, { key: "legal-terms", href: platform?.legalTermsUrl, icon: React.createElement(Policy, null), "data-testid": "legal-terms", kind: "app", text: "Legal Terms", type: "link" }),
|
|
78
|
+
React.createElement("span", { style: { borderBottom: "1px solid #b8c1c1" } }),
|
|
79
|
+
isCommunityEnabled && (React.createElement(HeaderMenuItem, { key: "community", href: platform?.communityUrl, icon: React.createElement(Forum, null), kind: "external", text: "Community", type: "link" })),
|
|
80
|
+
isFeedbackEnabled && (React.createElement(FeedbackMenuItem, { key: "feedback", platformName: platform?.platformName, platformOrganization: platform?.platformOrganization, sendIdeasUrl: sendIdeasUrl, sendBluePointsAwardUrl: sendBluePointsAwardUrl })),
|
|
81
|
+
!isPartnerUser && askICAEnabled ? (React.createElement(HeaderMenuItem, { key: "chat-launch", href: platform?.askICAUrl, icon: React.createElement(ChatLaunch, null), "data-testid": "askICA-chatlaunch", kind: "external", text: "AskICA", type: "link" })) : null,
|
|
82
|
+
!isPartnerUser && enableIcaMacs && (React.createElement(HeaderMenuItem, { key: "launch-ideation-agent", href: `${platform.baseEnvUrl}/launchpad/macs`, icon: React.createElement(Cognitive, null), "data-testid": "launch-ideation-agent", kind: "app", text: "AI Proposal Feedback Tool", type: "link" })),
|
|
83
|
+
isAboutPlatformEnabled && (React.createElement(AboutPlatformMenuItem, { key: "about-platform", name: platform.name, baseServicesUrl: platform.baseServicesUrl })),
|
|
84
|
+
tutorialScreenToShow && handleShowTutorial && (React.createElement(HeaderMenuItem, { key: "launch-tutorial", onClick: handleShowTutorial, icon: React.createElement(Book, null), "data-testid": "launch-tutorial", text: "Launch Tutorial", type: "button" })),
|
|
85
|
+
...supportMenuItems,
|
|
86
|
+
].filter(Boolean), history: history, isLaunchpad: isLaunchpad, isLoadingTeamSwitcher: isLoadingTeamSwitcher, isSuccessTeamSwitcher: isSuccessTeamSwitcher, refetchUser: refetchUser, refetchNavigation: refetchNavigation, setIsSuccessTeamSwitcher: setIsSuccessTeamSwitcher, trackEvent: trackEvent, user: user, userTeams: userTeams, userTeamsAssets: userTeamsAssets }),
|
|
87
|
+
isPrivacyModalRendered ? (React.createElement(PrivacyRedirect, { isOpen: true, baseEnvUrl: platform.baseEnvUrl, platformName: platform?.name, user: user })) : null));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Determine how to render the name and prefix in the Header based
|
|
91
|
+
* on what is passed in. If we only have the plaform or product name, then
|
|
92
|
+
* we want it to be bolded. If we have both, then make the platform the prefix
|
|
93
|
+
*/
|
|
94
|
+
function getProductAndPlatformNames(args) {
|
|
95
|
+
const { productName, platformName, platform } = args;
|
|
96
|
+
const resolvedPlatformName = platform.platformName ?? platformName;
|
|
97
|
+
let finalProductName = "";
|
|
98
|
+
let finalPlatformName = "";
|
|
99
|
+
if (productName && resolvedPlatformName) {
|
|
100
|
+
finalProductName = productName;
|
|
101
|
+
finalPlatformName = resolvedPlatformName;
|
|
102
|
+
}
|
|
103
|
+
else if (productName && !resolvedPlatformName) {
|
|
104
|
+
finalProductName = productName;
|
|
105
|
+
}
|
|
106
|
+
else if (!productName && resolvedPlatformName) {
|
|
107
|
+
finalProductName = resolvedPlatformName;
|
|
108
|
+
}
|
|
109
|
+
else ;
|
|
110
|
+
return { productName: finalProductName, platformName: finalPlatformName };
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export { UIShell as default };
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { QueryClient } from 'react-query';
|
|
3
3
|
|
|
4
|
-
/*
|
|
5
|
-
IBM Confidential
|
|
6
|
-
694970X, 69497O0
|
|
7
|
-
© Copyright IBM Corp. 2022, 2024
|
|
8
|
-
*/
|
|
9
|
-
const queryClient = new QueryClient({
|
|
10
|
-
defaultOptions: { queries: { refetchOnWindowFocus: false } },
|
|
11
|
-
});
|
|
12
|
-
const serviceUrl = {
|
|
13
|
-
getLaunchpadUser: ({ baseServicesUrl }) => `${baseServicesUrl}/launchpad/user`,
|
|
14
|
-
getPlatformVersion: ({ baseServicesUrl }) => `${baseServicesUrl}/users/platform/version`,
|
|
15
|
-
getStatement: ({ baseServicesUrl }) => `${baseServicesUrl}/users/consents`,
|
|
16
|
-
getTeamServices: ({ baseServicesUrl, teamId }) => `${baseServicesUrl}/launchpad/teams/${teamId}/services`,
|
|
17
|
-
getUserTeamsServices: ({ baseServicesUrl }) => `${baseServicesUrl}/users/teams/services`,
|
|
18
|
-
getUserTeamsServicesAssets: ({ baseServicesUrl }) => `${baseServicesUrl}/users/teams/services/assets`,
|
|
19
|
-
resourceUserConsent: ({ baseServicesUrl }) => `${baseServicesUrl}/users/consent`,
|
|
20
|
-
resourceUserProfile: ({ baseServicesUrl }) => `${baseServicesUrl}/users/profile`,
|
|
21
|
-
};
|
|
22
|
-
const resolver = {
|
|
23
|
-
query: (url, config) => () => axios.get(url, config).then((response) => response.data),
|
|
24
|
-
patchUserProfile: ({ baseServicesUrl, body }) => axios.patch(serviceUrl.resourceUserProfile({ baseServicesUrl }), body),
|
|
25
|
-
putUserConsent: ({ baseServicesUrl, body }) => axios.put(serviceUrl.resourceUserConsent({ baseServicesUrl }), body),
|
|
4
|
+
/*
|
|
5
|
+
IBM Confidential
|
|
6
|
+
694970X, 69497O0
|
|
7
|
+
© Copyright IBM Corp. 2022, 2024
|
|
8
|
+
*/
|
|
9
|
+
const queryClient = new QueryClient({
|
|
10
|
+
defaultOptions: { queries: { refetchOnWindowFocus: false } },
|
|
11
|
+
});
|
|
12
|
+
const serviceUrl = {
|
|
13
|
+
getLaunchpadUser: ({ baseServicesUrl }) => `${baseServicesUrl}/launchpad/user`,
|
|
14
|
+
getPlatformVersion: ({ baseServicesUrl }) => `${baseServicesUrl}/users/platform/version`,
|
|
15
|
+
getStatement: ({ baseServicesUrl }) => `${baseServicesUrl}/users/consents`,
|
|
16
|
+
getTeamServices: ({ baseServicesUrl, teamId }) => `${baseServicesUrl}/launchpad/teams/${teamId}/services`,
|
|
17
|
+
getUserTeamsServices: ({ baseServicesUrl }) => `${baseServicesUrl}/users/teams/services`,
|
|
18
|
+
getUserTeamsServicesAssets: ({ baseServicesUrl }) => `${baseServicesUrl}/users/teams/services/assets`,
|
|
19
|
+
resourceUserConsent: ({ baseServicesUrl }) => `${baseServicesUrl}/users/consent`,
|
|
20
|
+
resourceUserProfile: ({ baseServicesUrl }) => `${baseServicesUrl}/users/profile`,
|
|
21
|
+
};
|
|
22
|
+
const resolver = {
|
|
23
|
+
query: (url, config) => () => axios.get(url, config).then((response) => response.data),
|
|
24
|
+
patchUserProfile: ({ baseServicesUrl, body }) => axios.patch(serviceUrl.resourceUserProfile({ baseServicesUrl }), body),
|
|
25
|
+
putUserConsent: ({ baseServicesUrl, body }) => axios.put(serviceUrl.resourceUserConsent({ baseServicesUrl }), body),
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export { queryClient, resolver, serviceUrl };
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
/*
|
|
2
|
-
IBM Confidential
|
|
3
|
-
694970X, 69497O0
|
|
4
|
-
© Copyright IBM Corp. 2022, 2024
|
|
5
|
-
*/
|
|
6
|
-
const CHECKBOX_TYPES = {
|
|
7
|
-
CHECKBOX: "checkbox",
|
|
8
|
-
};
|
|
9
|
-
const CREATABLE_TYPES = {
|
|
10
|
-
CREATABLE_SINGLE: "creatable-single",
|
|
11
|
-
CREATABLE_SINGLE_NON_DELETABLE: "creatable-single-non-deletable",
|
|
12
|
-
CREATABLE_PAIR: "creatable-pair",
|
|
13
|
-
CREATABLE_PAIR_NON_DELETABLE: "creatable-pair-non-deletable",
|
|
14
|
-
};
|
|
15
|
-
const DATE_TYPES = {
|
|
16
|
-
DATE: "date",
|
|
17
|
-
DATE_RANGE: "date-range",
|
|
18
|
-
};
|
|
19
|
-
const MULTI_SELECT_TYPES = {
|
|
20
|
-
MULTI_SELECT: "multiselect",
|
|
21
|
-
};
|
|
22
|
-
const RADIO_TYPES = {
|
|
23
|
-
RADIO: "radio",
|
|
24
|
-
};
|
|
25
|
-
const SELECT_TYPES = {
|
|
26
|
-
SELECT: "select",
|
|
27
|
-
};
|
|
28
|
-
const TEXT_AREA_TYPES = {
|
|
29
|
-
TEXT_AREA: "textarea",
|
|
30
|
-
};
|
|
31
|
-
const TEXT_EDITOR_TYPES = {
|
|
32
|
-
TEXT_EDITOR: "texteditor",
|
|
33
|
-
};
|
|
34
|
-
const TEXT_INPUT_TYPES = {
|
|
35
|
-
TEXT: "text",
|
|
36
|
-
PASSWORD: "password",
|
|
37
|
-
SECURED: "secured",
|
|
38
|
-
NUMBER: "number",
|
|
39
|
-
URL: "url",
|
|
40
|
-
EMAIL: "email",
|
|
41
|
-
TIME: "time",
|
|
42
|
-
TEL: "tel",
|
|
43
|
-
};
|
|
44
|
-
const BOOLEAN_TYPES = {
|
|
45
|
-
BOOLEAN: "boolean",
|
|
46
|
-
};
|
|
47
|
-
const INPUT_GROUPS = {
|
|
48
|
-
CHECKBOX: "checkbox",
|
|
49
|
-
CREATABLE: "creatable",
|
|
50
|
-
DATE: "date",
|
|
51
|
-
MULTI_SELECT: "multiselect",
|
|
52
|
-
RADIO: "radio",
|
|
53
|
-
SELECT: "select",
|
|
54
|
-
TEXT_AREA: "textArea",
|
|
55
|
-
TEXT_EDITOR: "textEditor",
|
|
56
|
-
TEXT_INPUT: "textInput",
|
|
57
|
-
BOOLEAN: "boolean",
|
|
58
|
-
};
|
|
59
|
-
const ARRAY_INPUT_TYPES = {
|
|
60
|
-
...CHECKBOX_TYPES,
|
|
61
|
-
...CREATABLE_TYPES,
|
|
62
|
-
...MULTI_SELECT_TYPES,
|
|
63
|
-
};
|
|
64
|
-
const INPUT_TYPES_ARRAY = Object.values({
|
|
65
|
-
...BOOLEAN_TYPES,
|
|
66
|
-
...CHECKBOX_TYPES,
|
|
67
|
-
...CREATABLE_TYPES,
|
|
68
|
-
...DATE_TYPES,
|
|
69
|
-
...MULTI_SELECT_TYPES,
|
|
70
|
-
...RADIO_TYPES,
|
|
71
|
-
...SELECT_TYPES,
|
|
72
|
-
...TEXT_AREA_TYPES,
|
|
73
|
-
...TEXT_EDITOR_TYPES,
|
|
74
|
-
...TEXT_INPUT_TYPES,
|
|
1
|
+
/*
|
|
2
|
+
IBM Confidential
|
|
3
|
+
694970X, 69497O0
|
|
4
|
+
© Copyright IBM Corp. 2022, 2024
|
|
5
|
+
*/
|
|
6
|
+
const CHECKBOX_TYPES = {
|
|
7
|
+
CHECKBOX: "checkbox",
|
|
8
|
+
};
|
|
9
|
+
const CREATABLE_TYPES = {
|
|
10
|
+
CREATABLE_SINGLE: "creatable-single",
|
|
11
|
+
CREATABLE_SINGLE_NON_DELETABLE: "creatable-single-non-deletable",
|
|
12
|
+
CREATABLE_PAIR: "creatable-pair",
|
|
13
|
+
CREATABLE_PAIR_NON_DELETABLE: "creatable-pair-non-deletable",
|
|
14
|
+
};
|
|
15
|
+
const DATE_TYPES = {
|
|
16
|
+
DATE: "date",
|
|
17
|
+
DATE_RANGE: "date-range",
|
|
18
|
+
};
|
|
19
|
+
const MULTI_SELECT_TYPES = {
|
|
20
|
+
MULTI_SELECT: "multiselect",
|
|
21
|
+
};
|
|
22
|
+
const RADIO_TYPES = {
|
|
23
|
+
RADIO: "radio",
|
|
24
|
+
};
|
|
25
|
+
const SELECT_TYPES = {
|
|
26
|
+
SELECT: "select",
|
|
27
|
+
};
|
|
28
|
+
const TEXT_AREA_TYPES = {
|
|
29
|
+
TEXT_AREA: "textarea",
|
|
30
|
+
};
|
|
31
|
+
const TEXT_EDITOR_TYPES = {
|
|
32
|
+
TEXT_EDITOR: "texteditor",
|
|
33
|
+
};
|
|
34
|
+
const TEXT_INPUT_TYPES = {
|
|
35
|
+
TEXT: "text",
|
|
36
|
+
PASSWORD: "password",
|
|
37
|
+
SECURED: "secured",
|
|
38
|
+
NUMBER: "number",
|
|
39
|
+
URL: "url",
|
|
40
|
+
EMAIL: "email",
|
|
41
|
+
TIME: "time",
|
|
42
|
+
TEL: "tel",
|
|
43
|
+
};
|
|
44
|
+
const BOOLEAN_TYPES = {
|
|
45
|
+
BOOLEAN: "boolean",
|
|
46
|
+
};
|
|
47
|
+
const INPUT_GROUPS = {
|
|
48
|
+
CHECKBOX: "checkbox",
|
|
49
|
+
CREATABLE: "creatable",
|
|
50
|
+
DATE: "date",
|
|
51
|
+
MULTI_SELECT: "multiselect",
|
|
52
|
+
RADIO: "radio",
|
|
53
|
+
SELECT: "select",
|
|
54
|
+
TEXT_AREA: "textArea",
|
|
55
|
+
TEXT_EDITOR: "textEditor",
|
|
56
|
+
TEXT_INPUT: "textInput",
|
|
57
|
+
BOOLEAN: "boolean",
|
|
58
|
+
};
|
|
59
|
+
const ARRAY_INPUT_TYPES = {
|
|
60
|
+
...CHECKBOX_TYPES,
|
|
61
|
+
...CREATABLE_TYPES,
|
|
62
|
+
...MULTI_SELECT_TYPES,
|
|
63
|
+
};
|
|
64
|
+
const INPUT_TYPES_ARRAY = Object.values({
|
|
65
|
+
...BOOLEAN_TYPES,
|
|
66
|
+
...CHECKBOX_TYPES,
|
|
67
|
+
...CREATABLE_TYPES,
|
|
68
|
+
...DATE_TYPES,
|
|
69
|
+
...MULTI_SELECT_TYPES,
|
|
70
|
+
...RADIO_TYPES,
|
|
71
|
+
...SELECT_TYPES,
|
|
72
|
+
...TEXT_AREA_TYPES,
|
|
73
|
+
...TEXT_EDITOR_TYPES,
|
|
74
|
+
...TEXT_INPUT_TYPES,
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
export { ARRAY_INPUT_TYPES, BOOLEAN_TYPES, CHECKBOX_TYPES, CREATABLE_TYPES, DATE_TYPES, INPUT_GROUPS, INPUT_TYPES_ARRAY, MULTI_SELECT_TYPES, RADIO_TYPES, SELECT_TYPES, TEXT_AREA_TYPES, TEXT_EDITOR_TYPES, TEXT_INPUT_TYPES };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/*
|
|
2
|
-
IBM Confidential
|
|
3
|
-
694970X, 69497O0
|
|
4
|
-
© Copyright IBM Corp. 2022, 2024
|
|
5
|
-
*/
|
|
6
|
-
const USER_PLATFORM_ROLE = {
|
|
7
|
-
Admin: "admin",
|
|
8
|
-
Advisor: "advisor",
|
|
9
|
-
Operator: "operator",
|
|
10
|
-
Auditor: "auditor",
|
|
11
|
-
Author: "author",
|
|
12
|
-
User: "user",
|
|
13
|
-
Partner: "partner",
|
|
1
|
+
/*
|
|
2
|
+
IBM Confidential
|
|
3
|
+
694970X, 69497O0
|
|
4
|
+
© Copyright IBM Corp. 2022, 2024
|
|
5
|
+
*/
|
|
6
|
+
const USER_PLATFORM_ROLE = {
|
|
7
|
+
Admin: "admin",
|
|
8
|
+
Advisor: "advisor",
|
|
9
|
+
Operator: "operator",
|
|
10
|
+
Auditor: "auditor",
|
|
11
|
+
Author: "author",
|
|
12
|
+
User: "user",
|
|
13
|
+
Partner: "partner",
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { USER_PLATFORM_ROLE };
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
IBM Confidential
|
|
5
|
-
694970X, 69497O0
|
|
6
|
-
© Copyright IBM Corp. 2022, 2024
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Supports HeaderMenu components in the Header meeting usability and a11y guidelines
|
|
10
|
-
* Manage state for click/touch, escape and tab events
|
|
11
|
-
*/
|
|
12
|
-
function useHeaderMenu(focusableElementId) {
|
|
13
|
-
const ref = React.useRef(null);
|
|
14
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
15
|
-
const toggleActive = () => setIsOpen(!isOpen);
|
|
16
|
-
// Close menu if click event originates outside the menu
|
|
17
|
-
const handleMousedownEvent = React.useCallback((event) => {
|
|
18
|
-
if (!ref.current?.contains(event.target)) {
|
|
19
|
-
setIsOpen(false);
|
|
20
|
-
}
|
|
21
|
-
return;
|
|
22
|
-
}, []);
|
|
23
|
-
// Close menu if ESC keydown event originates in the menu and transfer focus
|
|
24
|
-
const handleKeyDownEvent = React.useCallback((event) => {
|
|
25
|
-
if (event.key === "Escape") {
|
|
26
|
-
if (ref.current?.contains(event.target)) {
|
|
27
|
-
document.getElementById(focusableElementId)?.focus();
|
|
28
|
-
setIsOpen(false);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return;
|
|
32
|
-
}, [focusableElementId]);
|
|
33
|
-
// Close menu if focus transfer event originates in the node AND
|
|
34
|
-
// transfers focus to a element OUTSIDE the menu
|
|
35
|
-
const handleFocusOutEvent = React.useCallback((event) => {
|
|
36
|
-
if (event.relatedTarget && !ref.current?.contains(event.relatedTarget)) {
|
|
37
|
-
setIsOpen(false);
|
|
38
|
-
}
|
|
39
|
-
return;
|
|
40
|
-
}, []);
|
|
41
|
-
React.useEffect(() => {
|
|
42
|
-
document.addEventListener("mousedown", handleMousedownEvent);
|
|
43
|
-
document.addEventListener("keydown", handleKeyDownEvent);
|
|
44
|
-
document.addEventListener("focusout", handleFocusOutEvent);
|
|
45
|
-
return () => {
|
|
46
|
-
document.removeEventListener("mousedown", handleMousedownEvent);
|
|
47
|
-
document.removeEventListener("keydown", handleKeyDownEvent);
|
|
48
|
-
document.removeEventListener("focusout", handleFocusOutEvent);
|
|
49
|
-
};
|
|
50
|
-
}, [handleMousedownEvent, handleKeyDownEvent, handleFocusOutEvent]);
|
|
51
|
-
return { isOpen, setIsOpen, toggleActive, ref };
|
|
3
|
+
/*
|
|
4
|
+
IBM Confidential
|
|
5
|
+
694970X, 69497O0
|
|
6
|
+
© Copyright IBM Corp. 2022, 2024
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Supports HeaderMenu components in the Header meeting usability and a11y guidelines
|
|
10
|
+
* Manage state for click/touch, escape and tab events
|
|
11
|
+
*/
|
|
12
|
+
function useHeaderMenu(focusableElementId) {
|
|
13
|
+
const ref = React.useRef(null);
|
|
14
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
15
|
+
const toggleActive = () => setIsOpen(!isOpen);
|
|
16
|
+
// Close menu if click event originates outside the menu
|
|
17
|
+
const handleMousedownEvent = React.useCallback((event) => {
|
|
18
|
+
if (!ref.current?.contains(event.target)) {
|
|
19
|
+
setIsOpen(false);
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}, []);
|
|
23
|
+
// Close menu if ESC keydown event originates in the menu and transfer focus
|
|
24
|
+
const handleKeyDownEvent = React.useCallback((event) => {
|
|
25
|
+
if (event.key === "Escape") {
|
|
26
|
+
if (ref.current?.contains(event.target)) {
|
|
27
|
+
document.getElementById(focusableElementId)?.focus();
|
|
28
|
+
setIsOpen(false);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
}, [focusableElementId]);
|
|
33
|
+
// Close menu if focus transfer event originates in the node AND
|
|
34
|
+
// transfers focus to a element OUTSIDE the menu
|
|
35
|
+
const handleFocusOutEvent = React.useCallback((event) => {
|
|
36
|
+
if (event.relatedTarget && !ref.current?.contains(event.relatedTarget)) {
|
|
37
|
+
setIsOpen(false);
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}, []);
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
document.addEventListener("mousedown", handleMousedownEvent);
|
|
43
|
+
document.addEventListener("keydown", handleKeyDownEvent);
|
|
44
|
+
document.addEventListener("focusout", handleFocusOutEvent);
|
|
45
|
+
return () => {
|
|
46
|
+
document.removeEventListener("mousedown", handleMousedownEvent);
|
|
47
|
+
document.removeEventListener("keydown", handleKeyDownEvent);
|
|
48
|
+
document.removeEventListener("focusout", handleFocusOutEvent);
|
|
49
|
+
};
|
|
50
|
+
}, [handleMousedownEvent, handleKeyDownEvent, handleFocusOutEvent]);
|
|
51
|
+
return { isOpen, setIsOpen, toggleActive, ref };
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export { useHeaderMenu as default };
|