@boomerang-io/carbon-addons-boomerang-react 4.6.21-beta.23 → 4.6.21-beta.25
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/dist/cjs/components/ProfileSettings/ProfileSettings.js +19 -1
- package/dist/cjs/components/UIShell/UIShell.js +2 -2
- package/dist/esm/components/ProfileSettings/ProfileSettings.js +19 -1
- package/dist/esm/components/UIShell/UIShell.js +2 -2
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/scss/components/ProfileSettings/_profileSettings.scss +1 -0
|
@@ -34,12 +34,13 @@ function determineIfConfigIsDifferent(teams, initialTeams) {
|
|
|
34
34
|
}
|
|
35
35
|
return isConfigDifferent;
|
|
36
36
|
}
|
|
37
|
-
function ProfileSettings({ baseServicesUrl, src, userName, isOpen, closeModal }) {
|
|
37
|
+
function ProfileSettings({ baseServicesUrl, refetchUser, refetchUserTeams, refetchNavigation, src, userName, isOpen, closeModal, }) {
|
|
38
38
|
const queryClient = reactQuery.useQueryClient();
|
|
39
39
|
const [initialTeams, setInitialTeams] = React.useState([]);
|
|
40
40
|
const [teams, setTeams] = React.useState([]);
|
|
41
41
|
const userUrl = servicesConfig.serviceUrl.getLaunchpadUser({ baseServicesUrl });
|
|
42
42
|
const profileUrl = servicesConfig.serviceUrl.resourceUserProfile({ baseServicesUrl });
|
|
43
|
+
const userTeamsUrl = servicesConfig.serviceUrl.getUserTeamsServices({ baseServicesUrl });
|
|
43
44
|
const { data: user, isLoading: userIsLoading, error: userError, } = reactQuery.useQuery({
|
|
44
45
|
queryKey: userUrl,
|
|
45
46
|
queryFn: servicesConfig.resolver.query(userUrl),
|
|
@@ -48,6 +49,22 @@ function ProfileSettings({ baseServicesUrl, src, userName, isOpen, closeModal })
|
|
|
48
49
|
onSuccess: () => {
|
|
49
50
|
queryClient.invalidateQueries(userUrl);
|
|
50
51
|
queryClient.invalidateQueries(profileUrl);
|
|
52
|
+
queryClient.invalidateQueries(userTeamsUrl);
|
|
53
|
+
if (refetchUser) {
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
refetchUser();
|
|
56
|
+
}, 1000);
|
|
57
|
+
}
|
|
58
|
+
if (refetchUserTeams) {
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
refetchUserTeams();
|
|
61
|
+
}, 1000);
|
|
62
|
+
}
|
|
63
|
+
if (refetchNavigation) {
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
refetchNavigation();
|
|
66
|
+
}, 1000);
|
|
67
|
+
}
|
|
51
68
|
},
|
|
52
69
|
});
|
|
53
70
|
// Only disable when we have a user and we know that there aren' any lower level groups to manage
|
|
@@ -63,6 +80,7 @@ function ProfileSettings({ baseServicesUrl, src, userName, isOpen, closeModal })
|
|
|
63
80
|
}
|
|
64
81
|
async function handleSubmit() {
|
|
65
82
|
const body = {
|
|
83
|
+
teamInstanceSwitcherDefault: null,
|
|
66
84
|
lowerLevelGroups: teams,
|
|
67
85
|
};
|
|
68
86
|
try {
|
|
@@ -26,7 +26,7 @@ IBM Confidential
|
|
|
26
26
|
694970X, 69497O0
|
|
27
27
|
© Copyright IBM Corp. 2022, 2024
|
|
28
28
|
*/
|
|
29
|
-
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, }) {
|
|
29
|
+
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, refetchUserTeams, refetchNavigation, skipToContentProps, templateMeteringEvent, trackEvent, triggerEvent, tutorialScreenToShow, user, userTeams, userTeamsAssets, enableIcaMacs, }) {
|
|
30
30
|
// Support base header .e.g for an error state
|
|
31
31
|
if (!config) {
|
|
32
32
|
return (React__default.default.createElement(reactQuery.QueryClientProvider, { client: servicesConfig.queryClient },
|
|
@@ -72,7 +72,7 @@ function UIShell({ analyticsHelpers, baseEnvUrl, carbonTheme = "g10", config, cr
|
|
|
72
72
|
const isPrivacyStatementDisabled = renderPrivacyStatement === false || features?.["consent.enabled"] === false;
|
|
73
73
|
return (React__default.default.createElement(reactQuery.QueryClientProvider, { client: servicesConfig.queryClient },
|
|
74
74
|
React__default.default.createElement(Header.default, { 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: [
|
|
75
|
-
isUserEnabled && (React__default.default.createElement(ProfileSettings.ProfileSettingsMenuItem, { key: "profile-settings", baseServicesUrl: platform.baseServicesUrl, src: `${platform.baseServicesUrl}/users/image/${user?.email}`, userName: user?.displayName ?? user?.name })),
|
|
75
|
+
isUserEnabled && (React__default.default.createElement(ProfileSettings.ProfileSettingsMenuItem, { key: "profile-settings", baseServicesUrl: platform.baseServicesUrl, src: `${platform.baseServicesUrl}/users/image/${user?.email}`, userName: user?.displayName ?? user?.name, refetchUser: refetchUser, refetchUserTeams: refetchUserTeams, refetchNavigation: refetchNavigation })),
|
|
76
76
|
isSendMailEnabled && (React__default.default.createElement(HeaderMenuItem.default, { key: "email-preferences", href: `${platform.baseEnvUrl}/launchpad/email-preferences`, icon: React__default.default.createElement(icons.Email, null), kind: "internal", text: "Email Preferences", type: "link" })),
|
|
77
77
|
!isPrivacyStatementDisabled && (React__default.default.createElement(PrivacyStatement.PrivacyStatementMenuItem, { key: "privacy-statement", baseServicesUrl: platform.baseServicesUrl, platformEmail: platform?.platformEmail })),
|
|
78
78
|
...profileMenuItems,
|
|
@@ -25,12 +25,13 @@ function determineIfConfigIsDifferent(teams, initialTeams) {
|
|
|
25
25
|
}
|
|
26
26
|
return isConfigDifferent;
|
|
27
27
|
}
|
|
28
|
-
function ProfileSettings({ baseServicesUrl, src, userName, isOpen, closeModal }) {
|
|
28
|
+
function ProfileSettings({ baseServicesUrl, refetchUser, refetchUserTeams, refetchNavigation, src, userName, isOpen, closeModal, }) {
|
|
29
29
|
const queryClient = useQueryClient();
|
|
30
30
|
const [initialTeams, setInitialTeams] = useState([]);
|
|
31
31
|
const [teams, setTeams] = useState([]);
|
|
32
32
|
const userUrl = serviceUrl.getLaunchpadUser({ baseServicesUrl });
|
|
33
33
|
const profileUrl = serviceUrl.resourceUserProfile({ baseServicesUrl });
|
|
34
|
+
const userTeamsUrl = serviceUrl.getUserTeamsServices({ baseServicesUrl });
|
|
34
35
|
const { data: user, isLoading: userIsLoading, error: userError, } = useQuery({
|
|
35
36
|
queryKey: userUrl,
|
|
36
37
|
queryFn: resolver.query(userUrl),
|
|
@@ -39,6 +40,22 @@ function ProfileSettings({ baseServicesUrl, src, userName, isOpen, closeModal })
|
|
|
39
40
|
onSuccess: () => {
|
|
40
41
|
queryClient.invalidateQueries(userUrl);
|
|
41
42
|
queryClient.invalidateQueries(profileUrl);
|
|
43
|
+
queryClient.invalidateQueries(userTeamsUrl);
|
|
44
|
+
if (refetchUser) {
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
refetchUser();
|
|
47
|
+
}, 1000);
|
|
48
|
+
}
|
|
49
|
+
if (refetchUserTeams) {
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
refetchUserTeams();
|
|
52
|
+
}, 1000);
|
|
53
|
+
}
|
|
54
|
+
if (refetchNavigation) {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
refetchNavigation();
|
|
57
|
+
}, 1000);
|
|
58
|
+
}
|
|
42
59
|
},
|
|
43
60
|
});
|
|
44
61
|
// Only disable when we have a user and we know that there aren' any lower level groups to manage
|
|
@@ -54,6 +71,7 @@ function ProfileSettings({ baseServicesUrl, src, userName, isOpen, closeModal })
|
|
|
54
71
|
}
|
|
55
72
|
async function handleSubmit() {
|
|
56
73
|
const body = {
|
|
74
|
+
teamInstanceSwitcherDefault: null,
|
|
57
75
|
lowerLevelGroups: teams,
|
|
58
76
|
};
|
|
59
77
|
try {
|
|
@@ -18,7 +18,7 @@ IBM Confidential
|
|
|
18
18
|
694970X, 69497O0
|
|
19
19
|
© Copyright IBM Corp. 2022, 2024
|
|
20
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, }) {
|
|
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, refetchUserTeams, refetchNavigation, skipToContentProps, templateMeteringEvent, trackEvent, triggerEvent, tutorialScreenToShow, user, userTeams, userTeamsAssets, enableIcaMacs, }) {
|
|
22
22
|
// Support base header .e.g for an error state
|
|
23
23
|
if (!config) {
|
|
24
24
|
return (React.createElement(QueryClientProvider, { client: queryClient },
|
|
@@ -64,7 +64,7 @@ function UIShell({ analyticsHelpers, baseEnvUrl, carbonTheme = "g10", config, cr
|
|
|
64
64
|
const isPrivacyStatementDisabled = renderPrivacyStatement === false || features?.["consent.enabled"] === false;
|
|
65
65
|
return (React.createElement(QueryClientProvider, { client: queryClient },
|
|
66
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 })),
|
|
67
|
+
isUserEnabled && (React.createElement(ProfileSettingsMenuItem, { key: "profile-settings", baseServicesUrl: platform.baseServicesUrl, src: `${platform.baseServicesUrl}/users/image/${user?.email}`, userName: user?.displayName ?? user?.name, refetchUser: refetchUser, refetchUserTeams: refetchUserTeams, refetchNavigation: refetchNavigation })),
|
|
68
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
69
|
!isPrivacyStatementDisabled && (React.createElement(PrivacyStatementMenuItem, { key: "privacy-statement", baseServicesUrl: platform.baseServicesUrl, platformEmail: platform?.platformEmail })),
|
|
70
70
|
...profileMenuItems,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1458,6 +1458,7 @@ type Props = {
|
|
|
1458
1458
|
};
|
|
1459
1459
|
refetchUser?: Function;
|
|
1460
1460
|
refetchNavigation?: Function;
|
|
1461
|
+
refetchUserTeams?: Function;
|
|
1461
1462
|
skipToContentProps?: {
|
|
1462
1463
|
href?: string;
|
|
1463
1464
|
children?: string;
|
|
@@ -1482,6 +1483,6 @@ type Props = {
|
|
|
1482
1483
|
handleShowTutorial?: Function;
|
|
1483
1484
|
tutorialScreenToShow?: string;
|
|
1484
1485
|
};
|
|
1485
|
-
declare function UIShell({ analyticsHelpers, baseEnvUrl, carbonTheme, config, createJoinTeamTrigger, history, isLaunchpad, isLoadingTeamSwitcher, isSuccessTeamSwitcher, setIsSuccessTeamSwitcher, leftPanel, platformName, productName, profileMenuItems, supportMenuItems, renderPrivacyRedirect, renderPrivacyStatement, rightPanel, handleShowTutorial, refetchUser, refetchNavigation, skipToContentProps, templateMeteringEvent, trackEvent, triggerEvent, tutorialScreenToShow, user, userTeams, userTeamsAssets, enableIcaMacs, }: Props): React.JSX.Element;
|
|
1486
|
+
declare function UIShell({ analyticsHelpers, baseEnvUrl, carbonTheme, config, createJoinTeamTrigger, history, isLaunchpad, isLoadingTeamSwitcher, isSuccessTeamSwitcher, setIsSuccessTeamSwitcher, leftPanel, platformName, productName, profileMenuItems, supportMenuItems, renderPrivacyRedirect, renderPrivacyStatement, rightPanel, handleShowTutorial, refetchUser, refetchUserTeams, refetchNavigation, skipToContentProps, templateMeteringEvent, trackEvent, triggerEvent, tutorialScreenToShow, user, userTeams, userTeamsAssets, enableIcaMacs, }: Props): React.JSX.Element;
|
|
1486
1487
|
|
|
1487
1488
|
export { AdvantageSideNav, AutoSuggestBmrg as AutoSuggest, Avatar, CheckboxListComponent as CheckboxList, ComboBoxComponent as ComboBox, ComboBoxMultiSelect, ComposedModal, ConfirmModal, CreatableComponent as Creatable, DataDrivenInput, DateInputComponent as DateInput, DecisionButtons, DelayedRender, DynamicFormik, DynamicInput, Error, Error403, Error404, ErrorBoundary, ErrorDragon, ErrorFullPage, Error as ErrorMessage, ErrorPage, ErrorPageCore, FeatureHeader, FeatureHeaderSubtitle, FeatureHeaderTitle, FeatureNavTab, FeatureNavTabs, FeatureSideNav, FeatureSideNavFooter, FeatureSideNavHeader, FeatureSideNavLink, FeatureSideNavLinks, FlowModalContainer as FlowModal, FlowModalForm, FormInput, Header, _default as HeaderMenuItem, ImageModal, InputGovernor, Loading, MemberBar, Modal, ModalConfirmEdit, FlowModalContainer as ModalFlow, FlowModalForm as ModalFlowForm, ModalForm, ModalFunctionChildrenProps, ModalTrigger, NotificationsContainer, PlatformBanner, PlatformNotificationsContainer, Portal, PrivacyStatement, ProtectedRoute, RadioGroupComponent as RadioGroup, RichTextAreaComponent as RichTextArea, SimpleTeamService, Team, TextAreaComponent as TextArea, TextInputComponent as TextInput, ToastNotification, ToggleComponent as Toggle, TooltipHover, UIShell, User, UserTeams, notify };
|
package/package.json
CHANGED