fix: env name truncate

This commit is contained in:
Pooja Belaramani
2024-12-19 11:00:51 +05:30
parent ad59e3f8d1
commit bf142af6d9
5 changed files with 20 additions and 15 deletions

View File

@@ -27,7 +27,7 @@ const DeleteEnvironment = ({ onClose, environment, collection }) => {
handleConfirm={onConfirm}
handleCancel={onClose}
>
<div className='flex gap-1'>Are you sure you want to delete <span className="font-semibold max-w-[200px] truncate inline-block">{environment.name}</span> ?</div>
Are you sure you want to delete <span className="font-semibold">{environment.name}</span> ?
</Modal>
</StyledWrapper>
</Portal>

View File

@@ -23,6 +23,10 @@ const StyledWrapper = styled.div`
padding: 8px 10px;
border-left: solid 2px transparent;
text-decoration: none;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&:hover {
text-decoration: none;

View File

@@ -8,6 +8,7 @@ import ImportEnvironment from '../ImportEnvironment';
import ManageSecrets from '../ManageSecrets';
import StyledWrapper from './StyledWrapper';
import ConfirmSwitchEnv from './ConfirmSwitchEnv';
import ToolHint from 'components/ToolHint';
const EnvironmentList = ({ selectedEnvironment, setSelectedEnvironment, collection, isModified, setIsModified }) => {
const { environments } = collection;
@@ -108,7 +109,9 @@ const EnvironmentList = ({ selectedEnvironment, setSelectedEnvironment, collecti
className={selectedEnvironment.uid === env.uid ? 'environment-item active' : 'environment-item'}
onClick={() => handleEnvironmentClick(env)} // Use handleEnvironmentClick to handle clicks
>
<span className="break-all">{env.name}</span>
<ToolHint text={env.name} toolhintId={env.uid} place="bottom">
<span className="break-all">{env.name}</span>
</ToolHint>
</div>
))}
<div className="btn-create-environment" onClick={() => handleCreateEnvClick()}>