mirror of
https://github.com/usebruno/bruno.git
synced 2025-02-21 20:21:47 +01:00
Merge pull request #3664 from pooja-bruno/fix/environment-names-wrapping
fix: env names wrap
This commit is contained in:
commit
7d67239b11
@ -19,7 +19,7 @@ const EnvironmentSelector = ({ collection }) => {
|
|||||||
const Icon = forwardRef((props, ref) => {
|
const Icon = forwardRef((props, ref) => {
|
||||||
return (
|
return (
|
||||||
<div ref={ref} className="current-environment flex items-center justify-center pl-3 pr-2 py-1 select-none">
|
<div ref={ref} className="current-environment flex items-center justify-center pl-3 pr-2 py-1 select-none">
|
||||||
{activeEnvironment ? activeEnvironment.name : 'No Environment'}
|
<p className="text-nowrap truncate max-w-32">{activeEnvironment ? activeEnvironment.name : 'No Environment'}</p>
|
||||||
<IconCaretDown className="caret" size={14} strokeWidth={2} />
|
<IconCaretDown className="caret" size={14} strokeWidth={2} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -23,6 +23,10 @@ const StyledWrapper = styled.div`
|
|||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
border-left: solid 2px transparent;
|
border-left: solid 2px transparent;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
max-width: 200px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -8,6 +8,7 @@ import ImportEnvironment from '../ImportEnvironment';
|
|||||||
import ManageSecrets from '../ManageSecrets';
|
import ManageSecrets from '../ManageSecrets';
|
||||||
import StyledWrapper from './StyledWrapper';
|
import StyledWrapper from './StyledWrapper';
|
||||||
import ConfirmSwitchEnv from './ConfirmSwitchEnv';
|
import ConfirmSwitchEnv from './ConfirmSwitchEnv';
|
||||||
|
import ToolHint from 'components/ToolHint';
|
||||||
|
|
||||||
const EnvironmentList = ({ selectedEnvironment, setSelectedEnvironment, collection, isModified, setIsModified }) => {
|
const EnvironmentList = ({ selectedEnvironment, setSelectedEnvironment, collection, isModified, setIsModified }) => {
|
||||||
const { environments } = collection;
|
const { environments } = collection;
|
||||||
@ -103,13 +104,15 @@ const EnvironmentList = ({ selectedEnvironment, setSelectedEnvironment, collecti
|
|||||||
{environments &&
|
{environments &&
|
||||||
environments.length &&
|
environments.length &&
|
||||||
environments.map((env) => (
|
environments.map((env) => (
|
||||||
<div
|
<ToolHint key={env.uid} text={env.name} toolhintId={env.uid} place="right">
|
||||||
key={env.uid}
|
<div
|
||||||
className={selectedEnvironment.uid === env.uid ? 'environment-item active' : 'environment-item'}
|
id={env.uid}
|
||||||
onClick={() => handleEnvironmentClick(env)} // Use handleEnvironmentClick to handle clicks
|
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>
|
>
|
||||||
</div>
|
<span className="break-all">{env.name}</span>
|
||||||
|
</div>
|
||||||
|
</ToolHint>
|
||||||
))}
|
))}
|
||||||
<div className="btn-create-environment" onClick={() => handleCreateEnvClick()}>
|
<div className="btn-create-environment" onClick={() => handleCreateEnvClick()}>
|
||||||
+ <span>Create</span>
|
+ <span>Create</span>
|
||||||
|
@ -117,7 +117,6 @@ const QueryParams = ({ item, collection }) => {
|
|||||||
<StyledWrapper className="w-full flex flex-col absolute">
|
<StyledWrapper className="w-full flex flex-col absolute">
|
||||||
<div className="flex-1 mt-2">
|
<div className="flex-1 mt-2">
|
||||||
<div className="mb-1 title text-xs">Query</div>
|
<div className="mb-1 title text-xs">Query</div>
|
||||||
|
|
||||||
<Table
|
<Table
|
||||||
headers={[
|
headers={[
|
||||||
{ name: 'Name', accessor: 'name', width: '31%' },
|
{ name: 'Name', accessor: 'name', width: '31%' },
|
||||||
@ -153,7 +152,7 @@ const QueryParams = ({ item, collection }) => {
|
|||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center justify-center">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={param.enabled}
|
checked={param.enabled}
|
||||||
@ -188,7 +187,7 @@ const QueryParams = ({ item, collection }) => {
|
|||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
infotipId="path-param-InfoTip"
|
infotipId="path-param-InfoTip"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
@ -241,11 +240,7 @@ const QueryParams = ({ item, collection }) => {
|
|||||||
: null}
|
: null}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{!(pathParams && pathParams.length) ?
|
{!(pathParams && pathParams.length) ? <div className="title pr-2 py-3 mt-2 text-xs"></div> : null}
|
||||||
<div className="title pr-2 py-3 mt-2 text-xs">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
: null}
|
|
||||||
</div>
|
</div>
|
||||||
</StyledWrapper>
|
</StyledWrapper>
|
||||||
);
|
);
|
||||||
|
@ -39,12 +39,15 @@ const RequestTabPanel = () => {
|
|||||||
const _collections = useSelector((state) => state.collections.collections);
|
const _collections = useSelector((state) => state.collections.collections);
|
||||||
|
|
||||||
// merge `globalEnvironmentVariables` into the active collection and rebuild `collections` immer proxy object
|
// merge `globalEnvironmentVariables` into the active collection and rebuild `collections` immer proxy object
|
||||||
let collections = produce(_collections, draft => {
|
let collections = produce(_collections, (draft) => {
|
||||||
let collection = find(draft, (c) => c.uid === focusedTab?.collectionUid);
|
let collection = find(draft, (c) => c.uid === focusedTab?.collectionUid);
|
||||||
|
|
||||||
if (collection) {
|
if (collection) {
|
||||||
// add selected global env variables to the collection object
|
// add selected global env variables to the collection object
|
||||||
const globalEnvironmentVariables = getGlobalEnvironmentVariables({ globalEnvironments, activeGlobalEnvironmentUid });
|
const globalEnvironmentVariables = getGlobalEnvironmentVariables({
|
||||||
|
globalEnvironments,
|
||||||
|
activeGlobalEnvironmentUid
|
||||||
|
});
|
||||||
const globalEnvSecrets = getGlobalEnvironmentVariablesMasked({ globalEnvironments, activeGlobalEnvironmentUid });
|
const globalEnvSecrets = getGlobalEnvironmentVariablesMasked({ globalEnvironments, activeGlobalEnvironmentUid });
|
||||||
collection.globalEnvironmentVariables = globalEnvironmentVariables;
|
collection.globalEnvironmentVariables = globalEnvironmentVariables;
|
||||||
collection.globalEnvSecrets = globalEnvSecrets;
|
collection.globalEnvSecrets = globalEnvSecrets;
|
||||||
|
Loading…
Reference in New Issue
Block a user