fix(ui): remove teams root route and redirect it to Organization (#8767)

* fix(ui): remove teams root route and redirect it to Organization

* update local string
This commit is contained in:
Chirag Madlani 2022-11-16 14:06:55 +05:30 committed by GitHub
parent 345bd6c3ee
commit 89a12f3c05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 70 deletions

View File

@ -170,7 +170,7 @@ const TeamDetailsV1 = ({
TitleBreadcrumbProps['titleLinks']
>([]);
const [addAttribute, setAddAttribute] = useState<AddAttribute>();
const [loading, setLoading] = useState<boolean>(true);
const [loading, setLoading] = useState<boolean>(false);
const [selectedEntity, setEntity] = useState<{
attribute: 'defaultRoles' | 'policies';
record: EntityReference;

View File

@ -275,6 +275,7 @@
"data-insight-chart": "Data insight chart",
"data-assets": "Data Assets",
"app-analytics": "App Analytics",
"no-team-found": "No team found.",
"quality": "Quality",
"insight": "Insight",
"govern": "Govern"

View File

@ -36,7 +36,6 @@ import {
ResourceEntity,
} from '../../components/PermissionProvider/PermissionProvider.interface';
import TeamDetailsV1 from '../../components/TeamDetails/TeamDetailsV1';
import Teams from '../../components/TeamDetails/Teams';
import {
INITIAL_PAGING_VALUE,
LIST_SIZE,
@ -216,8 +215,9 @@ const TeamsPage = () => {
}
} catch (error) {
showErrorToast(error as AxiosError, t('server.unexpected-response'));
}
} finally {
setIsPageLoading(false);
}
};
/**
@ -545,18 +545,10 @@ const TeamsPage = () => {
return <Loader />;
}
return (
return entityPermissions.ViewAll || entityPermissions.ViewBasic ? (
<>
{entityPermissions.ViewAll || entityPermissions.ViewBasic ? (
<>
{isUndefined(fqn) ? (
<Teams
data={allTeam}
showDeletedTeam={showDeletedTeam}
onAddTeamClick={handleAddTeam}
onShowDeletedTeamChange={handleShowDeletedTeam}
onTeamExpand={fetchAllTeams}
/>
{isEmpty(selectedTeam) ? (
<ErrorPlaceHolder>{t('label.no-team-found')}</ErrorPlaceHolder>
) : (
<TeamDetailsV1
afterDeleteAction={afterDeleteAction}
@ -606,8 +598,6 @@ const TeamsPage = () => {
</>
) : (
<ErrorPlaceHolder>{NO_PERMISSION_TO_VIEW}</ErrorPlaceHolder>
)}
</>
);
};

View File

@ -91,14 +91,6 @@ const GlobalSettingRouter = () => {
<Route exact path={getSettingPath()}>
<Redirect to={getTeamsWithFqnPath(TeamType.Organization)} />
</Route>
<Route
exact
component={TeamsPage}
path={getSettingPath(
GlobalSettingsMenuCategory.MEMBERS,
GlobalSettingOptions.TEAMS
)}
/>
<Route
exact
component={TeamsPage}
@ -108,6 +100,13 @@ const GlobalSettingRouter = () => {
true
)}
/>
<Route
path={getSettingPath(
GlobalSettingsMenuCategory.MEMBERS,
GlobalSettingOptions.TEAMS
)}>
<Redirect to={getTeamsWithFqnPath(TeamType.Organization)} />
</Route>
{/* Roles route start
* Do not change the order of these route
*/}