-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: async parser workers (#3834) Co-authored-by: lohit <[email protected]>
- Loading branch information
1 parent
b5bd259
commit 9f5f975
Showing
53 changed files
with
1,375 additions
and
256 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
packages/bruno-app/src/components/CollectionSettings/Auth/StyledWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import styled from 'styled-components'; | ||
|
||
const Wrapper = styled.div``; | ||
const Wrapper = styled.div` | ||
max-width: 800px; | ||
`; | ||
|
||
export default Wrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/bruno-app/src/components/CollectionSettings/Headers/StyledWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
packages/bruno-app/src/components/CollectionSettings/Info/StyledWrapper.js
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
packages/bruno-app/src/components/CollectionSettings/Info/index.js
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
import { getTotalRequestCountInCollection } from 'utils/collections/'; | ||
import { IconFolder, IconFileOff, IconWorld, IconApi } from '@tabler/icons'; | ||
|
||
const Info = ({ collection }) => { | ||
const totalRequestsInCollection = getTotalRequestCountInCollection(collection); | ||
|
||
return ( | ||
<div className="w-full flex flex-col h-fit"> | ||
<div className="rounded-lg py-6"> | ||
<div className="grid gap-6"> | ||
{/* Location Row */} | ||
<div className="flex items-start"> | ||
<div className="flex-shrink-0 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg"> | ||
<IconFolder className="w-5 h-5 text-blue-500" stroke={1.5} /> | ||
</div> | ||
<div className="ml-4"> | ||
<div className="font-semibold text-sm">Location</div> | ||
<div className="mt-1 text-sm text-muted break-all"> | ||
{collection.pathname} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{/* Environments Row */} | ||
<div className="flex items-start"> | ||
<div className="flex-shrink-0 p-3 bg-green-50 dark:bg-green-900/20 rounded-lg"> | ||
<IconWorld className="w-5 h-5 text-green-500" stroke={1.5} /> | ||
</div> | ||
<div className="ml-4"> | ||
<div className="font-semibold text-sm">Environments</div> | ||
<div className="mt-1 text-sm text-muted"> | ||
{collection.environments?.length || 0} environment{collection.environments?.length !== 1 ? 's' : ''} configured | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{/* Requests Row */} | ||
<div className="flex items-start"> | ||
<div className="flex-shrink-0 p-3 bg-purple-50 dark:bg-purple-900/20 rounded-lg"> | ||
<IconApi className="w-5 h-5 text-purple-500" stroke={1.5} /> | ||
</div> | ||
<div className="ml-4"> | ||
<div className="font-semibold text-sm">Requests</div> | ||
<div className="mt-1 text-sm text-muted"> | ||
{totalRequestsInCollection} request{totalRequestsInCollection !== 1 ? 's' : ''} in collection | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Info; |
25 changes: 25 additions & 0 deletions
25
...s/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/StyledWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import styled from 'styled-components'; | ||
|
||
const StyledWrapper = styled.div` | ||
&.card { | ||
background-color: ${(props) => props.theme.requestTabPanel.card.bg}; | ||
.title { | ||
border-top: 1px solid ${(props) => props.theme.requestTabPanel.cardTable.border}; | ||
border-left: 1px solid ${(props) => props.theme.requestTabPanel.cardTable.border}; | ||
border-right: 1px solid ${(props) => props.theme.requestTabPanel.cardTable.border}; | ||
border-top-left-radius: 3px; | ||
border-top-right-radius: 3px; | ||
} | ||
.table { | ||
thead { | ||
background-color: ${(props) => props.theme.requestTabPanel.cardTable.table.thead.bg}; | ||
color: ${(props) => props.theme.requestTabPanel.cardTable.table.thead.color}; | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export default StyledWrapper; |
50 changes: 50 additions & 0 deletions
50
packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import { flattenItems } from "utils/collections"; | ||
import { IconAlertTriangle } from '@tabler/icons'; | ||
import StyledWrapper from "./StyledWrapper"; | ||
|
||
const RequestsNotLoaded = ({ collection }) => { | ||
const flattenedItems = flattenItems(collection.items); | ||
const itemsFailedLoading = flattenedItems?.filter(item => item?.partial && !item?.loading); | ||
|
||
if (!itemsFailedLoading?.length) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<StyledWrapper className="w-full card my-2"> | ||
<div className="flex items-center gap-2 px-3 py-2 title bg-yellow-50 dark:bg-yellow-900/20"> | ||
<IconAlertTriangle size={16} className="text-yellow-500" /> | ||
<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}> | ||
<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; |
25 changes: 25 additions & 0 deletions
25
packages/bruno-app/src/components/CollectionSettings/Overview/StyledWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import styled from 'styled-components'; | ||
|
||
const StyledWrapper = styled.div` | ||
.partial { | ||
color: ${(props) => props.theme.colors.text.yellow}; | ||
opacity: 0.8; | ||
} | ||
.loading { | ||
color: ${(props) => props.theme.colors.text.muted}; | ||
opacity: 0.8; | ||
} | ||
.completed { | ||
color: ${(props) => props.theme.colors.text.green}; | ||
opacity: 0.8; | ||
} | ||
.failed { | ||
color: ${(props) => props.theme.colors.text.danger}; | ||
opacity: 0.8; | ||
} | ||
`; | ||
|
||
export default StyledWrapper; |
27 changes: 27 additions & 0 deletions
27
packages/bruno-app/src/components/CollectionSettings/Overview/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import StyledWrapper from "./StyledWrapper"; | ||
import Docs from "../Docs"; | ||
import Info from "./Info"; | ||
import { IconBox } from '@tabler/icons'; | ||
import RequestsNotLoaded from "./RequestsNotLoaded"; | ||
|
||
const Overview = ({ collection }) => { | ||
return ( | ||
<div className="h-full"> | ||
<div className="grid grid-cols-5 gap-4 h-full"> | ||
<div className="col-span-2"> | ||
<div className="text-xl font-semibold flex items-center gap-2"> | ||
<IconBox size={24} stroke={1.5} /> | ||
{collection?.name} | ||
</div> | ||
<Info collection={collection} /> | ||
<RequestsNotLoaded collection={collection} /> | ||
</div> | ||
<div className="col-span-3"> | ||
<Docs collection={collection} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Overview; |
Oops, something went wrong.