Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(root): Set instance link on name and not button anymore #1789

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions src/app/js/root-admin/Tenants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
import AddBoxIcon from '@mui/icons-material/AddBox';
import DeleteIcon from '@mui/icons-material/Delete';
import EditIcon from '@mui/icons-material/Edit';
import LaunchIcon from '@mui/icons-material/Launch';

import { getHost } from '../../../common/uris';
import CreateTenantDialog from './CreateTenantDialog';
Expand All @@ -18,7 +17,7 @@ import {
GridToolbarDensitySelector,
GridToolbarFilterButton,
} from '@mui/x-data-grid';
import { Button, Tooltip, Typography } from '@mui/material';
import { Button, Link, Tooltip, Typography } from '@mui/material';

const baseUrl = getHost();

Expand Down Expand Up @@ -240,17 +239,43 @@ const Tenants = ({ handleLogout }) => {
headerName: 'Nom',
flex: 4,
renderCell: params => {
const name = params.row.name;
return (
<Typography
<Link
href={`${baseUrl}/instance/${name}`}
target="_blank"
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
outline: 'none',
textDecoration: 'none',
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
padding: '0 16px',
'&:visited': {
color: '#0069A9',
},
'&:focus': {
borderBottom: '1px solid',
background: '#D9F3FF',
},
'&:hover': {
borderBottom: '1px solid',
background: '#D9F3FF',
textDecoration: 'none',
},
'&:active': {
background: '#0069A9',
color: '#D9F3FF',
},
}}
title={params.value}
>
{params.value}
</Typography>
</Link>
);
},
},
Expand Down Expand Up @@ -302,19 +327,6 @@ const Tenants = ({ handleLogout }) => {
});
},
},
{
field: 'open',
headerName: 'Ouvrir',
flex: 1,
renderCell: params => {
const name = params.row.name;
return (
<Button target={name} href={`${baseUrl}/instance/${name}`}>
<LaunchIcon />
</Button>
);
},
},
{
field: 'update',
headerName: 'Modifier',
Expand Down Expand Up @@ -357,6 +369,11 @@ const Tenants = ({ handleLogout }) => {
components={{
Toolbar: CustomToolbar,
}}
sx={{
"& .MuiDataGrid-cell[data-field='name']": {
padding: 0,
},
}}
/>
</div>
<CreateTenantDialog
Expand Down