@boomerang-io/carbon-addons-boomerang-react 4.6.14-beta.1 → 4.6.14-beta.2
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.
|
@@ -97,6 +97,12 @@ function HeaderTeamSwitcher({ analyticsHelpers, baseServicesUrl, createJoinTeamT
|
|
|
97
97
|
await mutateUserProfile({ baseServicesUrl, body });
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
+
const handleNoTeamsToSelect = async () => {
|
|
101
|
+
const body = {
|
|
102
|
+
teamInstanceSwitcherDefault: null,
|
|
103
|
+
};
|
|
104
|
+
await mutateUserProfile({ baseServicesUrl, body });
|
|
105
|
+
};
|
|
100
106
|
if (userHasTeams) {
|
|
101
107
|
if (!userTeamInstanceSwitcherDefault) {
|
|
102
108
|
if (userHasPersonalTeam) {
|
|
@@ -128,16 +134,22 @@ function HeaderTeamSwitcher({ analyticsHelpers, baseServicesUrl, createJoinTeamT
|
|
|
128
134
|
const newSelectedTeam = allTeams.find((team) => team.id === userTeamInstanceSwitcherDefault);
|
|
129
135
|
handleSelectTeam({ team: newSelectedTeam });
|
|
130
136
|
}
|
|
137
|
+
// if teams data loaded but there are no teams
|
|
138
|
+
}
|
|
139
|
+
else if (Boolean(userTeams?.data) || Boolean(teamsQuery?.data)) {
|
|
140
|
+
handleNoTeamsToSelect();
|
|
131
141
|
}
|
|
132
142
|
}, [
|
|
133
143
|
baseServicesUrl,
|
|
134
144
|
hasUserTeams,
|
|
135
145
|
mutateUserProfile,
|
|
136
146
|
selectedTeam,
|
|
147
|
+
teamsQuery?.data,
|
|
137
148
|
teamsQuery?.data?.accountTeams,
|
|
138
149
|
teamsQuery?.data?.personalTeam,
|
|
139
150
|
teamsQuery?.data?.standardTeams,
|
|
140
151
|
userTeamInstanceSwitcherDefault,
|
|
152
|
+
userTeams?.data,
|
|
141
153
|
userTeams?.data?.accountTeams,
|
|
142
154
|
userTeams?.data?.personalTeam,
|
|
143
155
|
userTeams?.data?.standardTeams,
|
|
@@ -88,6 +88,12 @@ function HeaderTeamSwitcher({ analyticsHelpers, baseServicesUrl, createJoinTeamT
|
|
|
88
88
|
await mutateUserProfile({ baseServicesUrl, body });
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
+
const handleNoTeamsToSelect = async () => {
|
|
92
|
+
const body = {
|
|
93
|
+
teamInstanceSwitcherDefault: null,
|
|
94
|
+
};
|
|
95
|
+
await mutateUserProfile({ baseServicesUrl, body });
|
|
96
|
+
};
|
|
91
97
|
if (userHasTeams) {
|
|
92
98
|
if (!userTeamInstanceSwitcherDefault) {
|
|
93
99
|
if (userHasPersonalTeam) {
|
|
@@ -119,16 +125,22 @@ function HeaderTeamSwitcher({ analyticsHelpers, baseServicesUrl, createJoinTeamT
|
|
|
119
125
|
const newSelectedTeam = allTeams.find((team) => team.id === userTeamInstanceSwitcherDefault);
|
|
120
126
|
handleSelectTeam({ team: newSelectedTeam });
|
|
121
127
|
}
|
|
128
|
+
// if teams data loaded but there are no teams
|
|
129
|
+
}
|
|
130
|
+
else if (Boolean(userTeams?.data) || Boolean(teamsQuery?.data)) {
|
|
131
|
+
handleNoTeamsToSelect();
|
|
122
132
|
}
|
|
123
133
|
}, [
|
|
124
134
|
baseServicesUrl,
|
|
125
135
|
hasUserTeams,
|
|
126
136
|
mutateUserProfile,
|
|
127
137
|
selectedTeam,
|
|
138
|
+
teamsQuery?.data,
|
|
128
139
|
teamsQuery?.data?.accountTeams,
|
|
129
140
|
teamsQuery?.data?.personalTeam,
|
|
130
141
|
teamsQuery?.data?.standardTeams,
|
|
131
142
|
userTeamInstanceSwitcherDefault,
|
|
143
|
+
userTeams?.data,
|
|
132
144
|
userTeams?.data?.accountTeams,
|
|
133
145
|
userTeams?.data?.personalTeam,
|
|
134
146
|
userTeams?.data?.standardTeams,
|
package/package.json
CHANGED