Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
ellipsize Row contents
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bradford committed Sep 13, 2023
1 parent 4162a96 commit 9efe5cd
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const BeaconRow = observer<BeaconRowProps>(({ beacon, ...props }) => {
shape={beacon.meta?.[0]?.current?.shape || undefined}
color={beacon.meta?.[0]?.current?.color || undefined}
/>
<Txt cy-test="beacon-display-name" normal>
<Txt cy-test="beacon-display-name" normal ellipsize>
{beacon?.computedNameWithHost || `${beacon.server?.computedName}`}
</Txt>
</RowTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const CommentsList = observer<CommentsListProps>(({ sort }) => {
bold={['all', 'favorited'].includes(presentationItem.id)}
muted={presentationItem.id === 'procedural'}
italic={presentationItem.id === 'procedural'}
ellipsize
>
{rowTitle(presentationItem)}
</Txt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const HostOrServerRow = observer<HostOrServerRowProps>(({ host, ...props
}
/>
{host.cobaltStrikeServer && <Txt muted>Server:</Txt>}
<Txt cy-test="hostName" bold={!!host.cobaltStrikeServer}>
<Txt cy-test="hostName" bold={!!host.cobaltStrikeServer} ellipsize>
{host.computedName}
</Txt>
</RowTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createSorter, dateShortFormat, isDefined, semanticIcons, VirtualizedLis
import type { SortType } from '@redeye/client/store';
import { SortDirection, useStore } from '@redeye/client/store';
import type { InfoType } from '@redeye/client/types/explore';
import { FlexSplitter } from '@redeye/ui-styles';
import { FlexSplitter, Txt } from '@redeye/ui-styles';
import { observer } from 'mobx-react-lite';
import type { ComponentProps } from 'react';
import { defaultInfoRowHeight, IconLabel, InfoRow, MessageRow, RowTime, RowTitle } from '../components';
Expand All @@ -29,7 +29,9 @@ export const OperatorsList = observer<OperatorsListProps>(({ ...props }) => {
{store.settings.momentTz(operator.startTime)?.format(dateShortFormat)}&mdash;
{store.settings.momentTz(operator.endTime)?.format(dateShortFormat)}
</RowTime>
<RowTitle>{operator.name}</RowTitle>
<RowTitle>
<Txt ellipsize>{operator.name}</Txt>
</RowTitle>
<FlexSplitter />
<IconLabel
cy-test="row-command-count"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createSorter, isDefined, semanticIcons, VirtualizedList } from '@redeye
import type { CommandTypeCountModel, SortType } from '@redeye/client/store';
import { SortDirection, useStore } from '@redeye/client/store';
import { defaultInfoRowHeight, IconLabel, InfoRow, MessageRow, RowTitle } from '@redeye/client/views';
import { FlexSplitter } from '@redeye/ui-styles';
import { FlexSplitter, Txt } from '@redeye/ui-styles';
import { observer } from 'mobx-react-lite';
import type { ComponentProps } from 'react';

Expand All @@ -22,7 +22,9 @@ export const OverviewCommandTypesList = observer<OverviewProps>(({ sort }) => {
) : (
commandTypes.map((commandTypeCount) => (
<InfoRow cy-test="commands" key={commandTypeCount.id} onClick={() => commandTypeCount.select()}>
<RowTitle>{commandTypeCount.text}</RowTitle>
<RowTitle>
<Txt ellipsize>{commandTypeCount.text}</Txt>
</RowTitle>
<FlexSplitter />
<IconLabel
cy-test="row-command-count"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createSorter, dateShortFormat, isDefined, semanticIcons, VirtualizedLis
import type { OperatorModel, SortType } from '@redeye/client/store';
import { SortDirection, useStore } from '@redeye/client/store';
import { defaultInfoRowHeight, IconLabel, InfoRow, MessageRow, RowTime, RowTitle } from '@redeye/client/views';
import { FlexSplitter } from '@redeye/ui-styles';
import { FlexSplitter, Txt } from '@redeye/ui-styles';
import { observer } from 'mobx-react-lite';
import type { ComponentProps } from 'react';

Expand All @@ -26,7 +26,9 @@ export const OverviewOperatorsList = observer<OverviewProps>(({ sort }) => {
{store.settings.momentTz(operator.startTime)?.format(dateShortFormat)}&mdash;
{store.settings.momentTz(operator.endTime)?.format(dateShortFormat)}
</RowTime>
<RowTitle>{operator.name}</RowTitle>
<RowTitle>
<Txt ellipsize>{operator.name}</Txt>
</RowTitle>
<FlexSplitter />
<IconLabel
cy-test="row-command-count"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ export const RowTime = observer(({ state: timeStatus, ...props }: TxtProps & { s
});

export const RowTitle = (props: FlexProps) => (
<Flex align="center" gap={4} css={{ fontWeight: CoreTokens.FontWeightBold }} {...props} />
<Flex align="center" gap={4} overflowHidden fill css={{ fontWeight: CoreTokens.FontWeightBold }} {...props} />
);
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CarbonIcon } from '@redeye/client/components';
import type { PresentationItemModel } from '@redeye/client/store';
import { useStore } from '@redeye/client/store';
import { InfoRow, RowTitle } from '@redeye/client/views';
import { CoreTokens, HeroButton, UtilityStyles } from '@redeye/ui-styles';
import { CoreTokens, HeroButton, Txt, UtilityStyles } from '@redeye/ui-styles';
import { observer } from 'mobx-react-lite';
import type { ComponentProps } from 'react';
import { IconLabel } from '..';
Expand Down Expand Up @@ -47,7 +47,7 @@ export const PresentationTopicItem = observer<PresentationTopicItemProps>(({ pre
`}
icon={getIcon(presentationItem)}
/>
{presentationItem.key}
<Txt ellipsize>{presentationItem.key}</Txt>
</RowTitle>
<IconLabel cy-test="count" value={presentationItem.count} icon={Chat16} title="Comments" />
<HeroButton
Expand Down

0 comments on commit 9efe5cd

Please sign in to comment.