mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-27 23:41:46 +02:00
Add autocompletion for headers value (#1142)
* feature: add autocompletion for headers value * chore: rename file to autocompleteConstants and move it to codemirror utils
This commit is contained in:
parent
0d3765ad66
commit
0d204694a6
@ -13,6 +13,7 @@ import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/acti
|
|||||||
import SingleLineEditor from 'components/SingleLineEditor';
|
import SingleLineEditor from 'components/SingleLineEditor';
|
||||||
import StyledWrapper from './StyledWrapper';
|
import StyledWrapper from './StyledWrapper';
|
||||||
import { headers as StandardHTTPHeaders } from 'know-your-http-well';
|
import { headers as StandardHTTPHeaders } from 'know-your-http-well';
|
||||||
|
import { MimeTypes } from 'utils/codemirror/autocompleteConstants';
|
||||||
const headerAutoCompleteList = StandardHTTPHeaders.map((e) => e.header);
|
const headerAutoCompleteList = StandardHTTPHeaders.map((e) => e.header);
|
||||||
|
|
||||||
const Headers = ({ collection }) => {
|
const Headers = ({ collection }) => {
|
||||||
@ -117,6 +118,7 @@ const Headers = ({ collection }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
collection={collection}
|
collection={collection}
|
||||||
|
autocomplete={MimeTypes}
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -9,6 +9,7 @@ import { sendRequest, saveRequest } from 'providers/ReduxStore/slices/collection
|
|||||||
import SingleLineEditor from 'components/SingleLineEditor';
|
import SingleLineEditor from 'components/SingleLineEditor';
|
||||||
import StyledWrapper from './StyledWrapper';
|
import StyledWrapper from './StyledWrapper';
|
||||||
import { headers as StandardHTTPHeaders } from 'know-your-http-well';
|
import { headers as StandardHTTPHeaders } from 'know-your-http-well';
|
||||||
|
import { MimeTypes } from 'utils/codemirror/autocompleteConstants';
|
||||||
const headerAutoCompleteList = StandardHTTPHeaders.map((e) => e.header);
|
const headerAutoCompleteList = StandardHTTPHeaders.map((e) => e.header);
|
||||||
|
|
||||||
const RequestHeaders = ({ item, collection }) => {
|
const RequestHeaders = ({ item, collection }) => {
|
||||||
@ -115,6 +116,7 @@ const RequestHeaders = ({ item, collection }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
onRun={handleRun}
|
onRun={handleRun}
|
||||||
|
autocomplete={MimeTypes}
|
||||||
allowNewlines={true}
|
allowNewlines={true}
|
||||||
collection={collection}
|
collection={collection}
|
||||||
/>
|
/>
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
export const MimeTypes = [
|
||||||
|
'application/atom+xml',
|
||||||
|
'application/ecmascript',
|
||||||
|
'application/json',
|
||||||
|
'application/vnd.api+json',
|
||||||
|
'application/javascript',
|
||||||
|
'application/octet-stream',
|
||||||
|
'application/ogg',
|
||||||
|
'application/pdf',
|
||||||
|
'application/postscript',
|
||||||
|
'application/rdf+xml',
|
||||||
|
'application/rss+xml',
|
||||||
|
'application/soap+xml',
|
||||||
|
'application/font-woff',
|
||||||
|
'application/x-yaml',
|
||||||
|
'application/xhtml+xml',
|
||||||
|
'application/xml',
|
||||||
|
'application/xml-dtd',
|
||||||
|
'application/xop+xml',
|
||||||
|
'application/zip',
|
||||||
|
'application/gzip',
|
||||||
|
'application/graphql',
|
||||||
|
'application/x-www-form-urlencoded',
|
||||||
|
'audio/basic',
|
||||||
|
'audio/L24',
|
||||||
|
'audio/mp4',
|
||||||
|
'audio/mpeg',
|
||||||
|
'audio/ogg',
|
||||||
|
'audio/vorbis',
|
||||||
|
'audio/vnd.rn-realaudio',
|
||||||
|
'audio/vnd.wave',
|
||||||
|
'audio/webm',
|
||||||
|
'image/gif',
|
||||||
|
'image/jpeg',
|
||||||
|
'image/pjpeg',
|
||||||
|
'image/png',
|
||||||
|
'image/svg+xml',
|
||||||
|
'image/tiff',
|
||||||
|
'message/http',
|
||||||
|
'message/imdn+xml',
|
||||||
|
'message/partial',
|
||||||
|
'message/rfc822',
|
||||||
|
'multipart/mixed',
|
||||||
|
'multipart/alternative',
|
||||||
|
'multipart/related',
|
||||||
|
'multipart/form-data',
|
||||||
|
'multipart/signed',
|
||||||
|
'multipart/encrypted',
|
||||||
|
'text/cmd',
|
||||||
|
'text/css',
|
||||||
|
'text/csv',
|
||||||
|
'text/html',
|
||||||
|
'text/plain',
|
||||||
|
'text/vcard',
|
||||||
|
'text/xml'
|
||||||
|
];
|
Loading…
x
Reference in New Issue
Block a user