@boomerang-io/carbon-addons-boomerang-react 4.6.14-beta.1 → 4.6.14-beta.3
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,6 +134,17 @@ 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 ((hasUserTeams &&
|
|
140
|
+
userTeams?.data?.accountTeams?.length === 0 &&
|
|
141
|
+
userTeams?.data?.standardTeams?.length === 0 &&
|
|
142
|
+
userTeams?.data?.personalTeam?.length === 0) ||
|
|
143
|
+
(!hasUserTeams &&
|
|
144
|
+
teamsQuery?.data?.accountTeams?.length === 0 &&
|
|
145
|
+
teamsQuery?.data?.standardTeams?.length === 0 &&
|
|
146
|
+
teamsQuery?.data?.personalTeam?.length === 0)) {
|
|
147
|
+
handleNoTeamsToSelect();
|
|
131
148
|
}
|
|
132
149
|
}, [
|
|
133
150
|
baseServicesUrl,
|
|
@@ -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,6 +125,17 @@ 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 ((hasUserTeams &&
|
|
131
|
+
userTeams?.data?.accountTeams?.length === 0 &&
|
|
132
|
+
userTeams?.data?.standardTeams?.length === 0 &&
|
|
133
|
+
userTeams?.data?.personalTeam?.length === 0) ||
|
|
134
|
+
(!hasUserTeams &&
|
|
135
|
+
teamsQuery?.data?.accountTeams?.length === 0 &&
|
|
136
|
+
teamsQuery?.data?.standardTeams?.length === 0 &&
|
|
137
|
+
teamsQuery?.data?.personalTeam?.length === 0)) {
|
|
138
|
+
handleNoTeamsToSelect();
|
|
122
139
|
}
|
|
123
140
|
}, [
|
|
124
141
|
baseServicesUrl,
|
package/package.json
CHANGED