mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-07 22:18:33 +00:00
* style: enhance button layout and input styles across multiple components for improved UI consistency * style: update RequestsNotLoaded component with new warning styles and enhance theme color definitions for status indicators * refactor: update theme usage across components for consistency - Changed color references from theme.brand to theme.primary.text in various StyledWrapper components. - Added hover effects to enhance UI interactivity in CollectionSettings and FolderSettings. - Removed unnecessary margin and padding adjustments in several components for cleaner layout. - Improved accessibility by ensuring aria attributes are correctly set in MenuDropdown. - Standardized styling for method indicators in RequestPane components. These changes aim to create a more cohesive look and feel across the application while adhering to the updated theme guidelines. * refactor: clean up method selector styling in NewRequest component * chore: temp playwright test fixes * refactor: update modal sizes across various components for consistency - Changed modal size from "sm" to "md" in RenameWorkspace, CreateApiSpec, CloneCollection, DeleteCollectionItem, and RenameCollection components. - Improved styling in HttpMethodSelector by adding padding for better layout. - Updated theme color references in multiple theme files to use a new palette structure for consistency and maintainability. * refactor: enhance styling and theme integration in TimelineItem components - Updated HttpMethodSelector to clarify padding calculation in comments. - Integrated theme colors for OAuth2 indicator and timestamp in TimelineItem for better visual consistency. - Adjusted Method component to use uppercase styling for method display. - Modified RelativeTime component to apply muted text color for improved readability. - Updated INFO color in dark and light themes for better contrast and accessibility. * refactor: remove duplicate import statements in theme files - Cleaned up import statements in vscode.js and light-pastel.js by removing redundant lines for improved code clarity and maintainability. * refactor: improve styling and theme integration in various components - Added accent color and cursor style for checkbox inputs in Modal's StyledWrapper. - Updated border-radius values in HttpMethodSelector and NewRequest StyledWrapper components to use theme variables for consistency. - Introduced a new textbox class in NewRequest StyledWrapper for better styling control. - Changed modal size from "sm" to "md" in CreateEnvironment for improved layout. --------- Co-authored-by: Bijin A B <bijin@usebruno.com>
79 lines
2.4 KiB
JavaScript
79 lines
2.4 KiB
JavaScript
import React from 'react';
|
|
import { flattenItems } from 'utils/collections';
|
|
import { IconAlertTriangle } from '@tabler/icons';
|
|
import StyledWrapper from './StyledWrapper';
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
import { isItemARequest, itemIsOpenedInTabs } from 'utils/tabs/index';
|
|
import { getDefaultRequestPaneTab } from 'utils/collections/index';
|
|
import { addTab, focusTab } from 'providers/ReduxStore/slices/tabs';
|
|
|
|
const RequestsNotLoaded = ({ collection }) => {
|
|
const dispatch = useDispatch();
|
|
const tabs = useSelector((state) => state.tabs.tabs);
|
|
const flattenedItems = flattenItems(collection.items);
|
|
const itemsFailedLoading = flattenedItems?.filter((item) => item?.partial && !item?.loading);
|
|
|
|
if (!itemsFailedLoading?.length) {
|
|
return null;
|
|
}
|
|
|
|
const handleRequestClick = (item) => (e) => {
|
|
e.preventDefault();
|
|
if (isItemARequest(item)) {
|
|
if (itemIsOpenedInTabs(item, tabs)) {
|
|
dispatch(
|
|
focusTab({
|
|
uid: item.uid
|
|
})
|
|
);
|
|
return;
|
|
}
|
|
dispatch(
|
|
addTab({
|
|
uid: item.uid,
|
|
collectionUid: collection.uid,
|
|
requestPaneTab: getDefaultRequestPaneTab(item)
|
|
})
|
|
);
|
|
return;
|
|
}
|
|
};
|
|
|
|
return (
|
|
<StyledWrapper className="w-full card my-2">
|
|
<div className="flex items-center gap-2 px-3 py-2 title">
|
|
<IconAlertTriangle size={16} className="warning-icon" />
|
|
<span className="font-medium">Following requests were not loaded</span>
|
|
</div>
|
|
<table className="w-full border-collapse">
|
|
<thead>
|
|
<tr>
|
|
<th className="py-2 px-3 text-left font-medium">
|
|
Pathname
|
|
</th>
|
|
<th className="py-2 px-3 text-left font-medium">
|
|
Size
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{flattenedItems?.map((item, index) => (
|
|
item?.partial && !item?.loading ? (
|
|
<tr key={index} className="cursor-pointer" onClick={handleRequestClick(item)}>
|
|
<td className="py-1.5 px-3">
|
|
{item?.pathname?.split(`${collection?.pathname}/`)?.[1]}
|
|
</td>
|
|
<td className="py-1.5 px-3">
|
|
{item?.size?.toFixed?.(2)} MB
|
|
</td>
|
|
</tr>
|
|
) : null
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
</StyledWrapper>
|
|
);
|
|
};
|
|
|
|
export default RequestsNotLoaded;
|