Skip to content

Commit e41e2b1

Browse files
committed
support json openapi spec
1 parent f32673d commit e41e2b1

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

src/components/molecules/flow/AddNodes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const AddNodes = ({ collectionId }) => {
5050

5151
// Get all requests of this collections
5252
const collection = useCollectionStore.getState().collections.find((c) => c.id === collectionId);
53+
console.log(collection);
5354
const nodesByTags = orderNodesByTags(collection.nodes, searchFilter);
5455

5556
return (

src/components/molecules/flow/utils.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ export const orderNodesByTags = (nodes, filter) => {
1212
}
1313
if (filterNodes) {
1414
filterNodes.map((node) => {
15-
node.tags.map((tag) => {
16-
if (!result[tag]) {
17-
result[tag] = [];
15+
if (node.tags) {
16+
node.tags.map((tag) => {
17+
if (!result[tag]) {
18+
result[tag] = [];
19+
}
20+
result[tag].push(node);
21+
});
22+
} else {
23+
if (!result['All']) {
24+
result['All'] = [];
1825
}
19-
result[tag].push(node);
20-
});
26+
result['All'].push(node);
27+
}
2128
});
2229
}
2330
return Object.keys(result)

src/components/molecules/modals/ImportCollectionModal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const ImportCollectionModal = ({ closeFn = () => null, open = false }) => {
107107
<div className='mt-4'>
108108
<ul className='text-lg font-medium'>
109109
<li
110-
className={`hover:bg-background-light cursor-pointer rounded border border-transparent px-2 py-4 ${selectedFilePath ? 'text-green-500' : ''}`}
110+
className={`cursor-pointer rounded border border-transparent px-2 py-4 hover:bg-background-light ${selectedFilePath ? 'text-green-500' : ''}`}
111111
onClick={handleImportCollectionClick}
112112
data-import-type='yaml'
113113
>
@@ -125,7 +125,7 @@ const ImportCollectionModal = ({ closeFn = () => null, open = false }) => {
125125
<input
126126
type='file'
127127
id='file'
128-
accept='.yaml,.yml'
128+
accept='.yaml,.yml,.json'
129129
ref={importYamlFile}
130130
onChange={handleFileSelection}
131131
/>
@@ -141,7 +141,7 @@ const ImportCollectionModal = ({ closeFn = () => null, open = false }) => {
141141
)}
142142
</li>
143143
<li
144-
className={`hover:bg-background-light flex cursor-pointer items-center justify-start gap-4 px-2 py-4 ${selectedFilePath ? 'cursor-default' : 'cursor-not-allowed'}`}
144+
className={`flex cursor-pointer items-center justify-start gap-4 px-2 py-4 hover:bg-background-light ${selectedFilePath ? 'cursor-default' : 'cursor-not-allowed'}`}
145145
onClick={handleDirectorySelectionClick}
146146
>
147147
<div className='flex items-center justify-center w-8 h-8 border-4 rounded-full border-cyan-900'>

0 commit comments

Comments
 (0)