Skip to content
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
128 changes: 65 additions & 63 deletions src/components/Errors/GlobalErrorsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,70 +162,72 @@ export const GlobalErrorsList = () => {
return (
<s.Container>
{list ? (
list.length > 0 ? (
<>
<s.ToolbarContainer>
<SearchInput value={search} onChange={handleSearchInputChange} />
<NewPopover
isOpen={isSortingMenuOpen}
onOpenChange={setIsSortingMenuOpen}
content={
<Popup>
<MenuList items={sortingMenuItems} />
</Popup>
}
placement={"bottom-end"}
>
<NewButton
icon={() => (
<s.SortButtonIconContainer>
<OppositeArrowsIcon size={12} color={"currentColor"} />
</s.SortButtonIconContainer>
)}
label={"Sort"}
buttonType={"secondary"}
onClick={handleSortingMenuButtonClick}
/>
</NewPopover>
</s.ToolbarContainer>
<s.ListContainer ref={listContainerRef}>
{list.map((x) => (
<NewErrorCard
key={x.id}
data={x}
onSourceLinkClick={handleErrorSourceLinkClick}
/>
))}
</s.ListContainer>
<Pagination
itemsCount={totalCount}
page={page}
pageSize={pageSize}
onPageChange={handlePageChange}
extendedNavigation={true}
withDescription={true}
<>
<s.ToolbarContainer>
<SearchInput value={search} onChange={handleSearchInputChange} />
<NewPopover
isOpen={isSortingMenuOpen}
onOpenChange={setIsSortingMenuOpen}
content={
<Popup>
<MenuList items={sortingMenuItems} />
</Popup>
}
placement={"bottom-end"}
>
<NewButton
icon={() => (
<s.SortButtonIconContainer>
<OppositeArrowsIcon size={12} color={"currentColor"} />
</s.SortButtonIconContainer>
)}
label={"Sort"}
buttonType={"secondary"}
onClick={handleSortingMenuButtonClick}
/>
</NewPopover>
</s.ToolbarContainer>
{list.length > 0 ? (
<>
<s.ListContainer ref={listContainerRef}>
{list.map((x) => (
<NewErrorCard
key={x.id}
data={x}
onSourceLinkClick={handleErrorSourceLinkClick}
/>
))}
</s.ListContainer>
<Pagination
itemsCount={totalCount}
page={page}
pageSize={pageSize}
onPageChange={handlePageChange}
extendedNavigation={true}
withDescription={true}
/>
</>
) : areAnyFiltersApplied ? (
<NewEmptyState
icon={CardsColoredIcon}
title={"No errors"}
content={
<s.EmptyStateContent>
<span>
No data is available for the selected filters. Try resetting
your filters.
</span>
<NewButton
label={"Reset filters"}
onClick={handleResetFiltersButtonClick}
/>
</s.EmptyStateContent>
}
/>
</>
) : areAnyFiltersApplied ? (
<NewEmptyState
icon={CardsColoredIcon}
title={"No errors"}
content={
<s.EmptyStateContent>
<span>
No data is available for the selected filters. Try resetting
your filters.
</span>
<NewButton
label={"Reset filters"}
onClick={handleResetFiltersButtonClick}
/>
</s.EmptyStateContent>
}
/>
) : (
<NoDataEmptyState />
)
) : (
<NoDataEmptyState />
)}
</>
) : null}
</s.Container>
);
Expand Down
7 changes: 4 additions & 3 deletions src/components/Errors/NewErrorCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ import * as s from "./styles";
import { NewErrorCardProps } from "./types";

const getStatusTagType = (status: string): TagType => {
if (status === "High number of errors") {
const statusString = status.toLowerCase();
if (statusString.localeCompare("high number of errors")) {
return "highSeverity";
}

if (status === "Escalating") {
if (statusString.localeCompare("escalating")) {
return "mediumSeverity";
}

if (status.includes("Recent")) {
if (statusString.includes("recent")) {
return "lowSeverity";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const EndpointName = styled.div<EndpointNameProps>`
${ServiceName} {
flex-shrink: 0;
width: 151px;
max-width: none;
}
`;
}
Expand Down