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

fix query bar spacing bug #2247

Merged
merged 3 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ui/packages/shared/components/src/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Select = ({
<Listbox.Button
className={cx(
width !== undefined ? `w-${width}` : '',
'relative bg-gray-50 dark:bg-gray-900 border-t border-r border-b border-l dark:border-gray-600 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm text-sm w-[270px]',
'relative bg-gray-50 dark:bg-gray-900 border-t border-r border-b border-l dark:border-gray-600 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm text-sm',
{[className]: className.length > 0}
)}
>
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/shared/profile/src/MatchersInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const MatchersInput = ({
const profileSelected = currentQuery.profileName() === '';

return (
<div className="font-mono flex-1 w-full block">
<div className="font-mono flex-1 w-full min-w-[300px]">
<TextareaAutosize
ref={inputRef}
className={cx(
Expand Down
80 changes: 40 additions & 40 deletions ui/packages/shared/profile/src/ProfileSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
useGrpcMetadata,
} from '@parca/components';
import {CloseIcon} from '@parca/icons';
import cx from 'classnames';
import ProfileTypeSelector from '../ProfileTypeSelector/index';

export interface QuerySelection {
Expand Down Expand Up @@ -179,53 +178,54 @@ const ProfileSelector = ({

return (
<Card>
<Card.Header className={cx(comparing && 'overflow-x-scroll')}>
<div className="flex space-x-4">
{comparing && (
<button type="button" onClick={() => closeProfile()}>
<CloseIcon />
</button>
)}
<ProfileTypeSelector
profileTypesData={profileTypesData}
loading={profileTypesLoading}
selectedKey={selectedProfileName}
onSelection={setProfileName}
error={error}
/>
<MatchersInput
queryClient={queryClient}
setMatchersString={setMatchersString}
runQuery={setQueryExpression}
currentQuery={query}
/>
<Card.Header className="flex space-x-2">
<div className="flex flex-wrap w-full justify-start space-x-2 space-y-1">
<div className="ml-2 mt-1">
<ProfileTypeSelector
profileTypesData={profileTypesData}
loading={profileTypesLoading}
selectedKey={selectedProfileName}
onSelection={setProfileName}
error={error}
/>
</div>
<div className="w-full flex-1">
<MatchersInput
queryClient={queryClient}
setMatchersString={setMatchersString}
runQuery={setQueryExpression}
currentQuery={query}
/>
</div>
<DateTimeRangePicker
onRangeSelection={setTimeRangeSelection}
range={timeRangeSelection}
/>
{searchDisabled ? (
<div>
<Button disabled={true}>Search</Button>
</div>
) : (
<>
<ButtonGroup style={{marginRight: 5}}>
<ButtonGroup>
{!searchDisabled && (
<>
<MergeButton disabled={mergeDisabled} onClick={setMergedSelection} />
{!comparing && (
<CompareButton disabled={compareDisabled} onClick={handleCompareClick} />
)}
</ButtonGroup>
<div>
<Button
onClick={(e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
setQueryExpression();
}}
>
Search
</Button>
</div>
</>
</>
)}
<Button
disabled={searchDisabled}
onClick={(e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
setQueryExpression();
}}
>
Search
</Button>
</ButtonGroup>
</div>
<div>
{comparing && (
<button type="button" onClick={() => closeProfile()}>
<CloseIcon />
</button>
)}
</div>
</Card.Header>
Expand Down