mockaton 10.3.2 → 10.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ApiConstants.js +3 -0
- package/src/Dashboard.css +2 -0
- package/src/Dashboard.js +13 -4
package/package.json
CHANGED
package/src/ApiConstants.js
CHANGED
|
@@ -28,8 +28,11 @@ export const DF = { // Dashboard Fields (XHR)
|
|
|
28
28
|
syncVersion: 'last_received_sync_version'
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// TODO @ThinkAbout these affecting partial matches when bulk-selecting
|
|
32
|
+
// e.g. 'ton' would match
|
|
31
33
|
export const AUTOGENERATED_500_COMMENT = '(Mockaton 500)'
|
|
32
34
|
export const DEFAULT_MOCK_COMMENT = '(default)'
|
|
35
|
+
|
|
33
36
|
export const EXT_FOR_UNKNOWN_MIME = 'unknown'
|
|
34
37
|
export const LONG_POLL_SERVER_TIMEOUT = 8_000
|
|
35
38
|
|
package/src/Dashboard.css
CHANGED
|
@@ -586,6 +586,7 @@ table {
|
|
|
586
586
|
padding-top: 16px;
|
|
587
587
|
|
|
588
588
|
h2 {
|
|
589
|
+
padding-bottom: 4px;
|
|
589
590
|
padding-left: 16px;
|
|
590
591
|
}
|
|
591
592
|
|
|
@@ -593,6 +594,7 @@ table {
|
|
|
593
594
|
overflow: auto;
|
|
594
595
|
height: 100%;
|
|
595
596
|
padding: 16px;
|
|
597
|
+
padding-top: 12px;
|
|
596
598
|
font-family: monospace;
|
|
597
599
|
|
|
598
600
|
code {
|
package/src/Dashboard.js
CHANGED
|
@@ -239,6 +239,7 @@ function BulkSelector() {
|
|
|
239
239
|
mockaton.bulkSelectByComment(value)
|
|
240
240
|
.then(parseError)
|
|
241
241
|
.then(updateState)
|
|
242
|
+
.then(() => focus(`.${CSS.BulkSelector}`))
|
|
242
243
|
.catch(onError)
|
|
243
244
|
}
|
|
244
245
|
const disabled = !comments.length
|
|
@@ -295,6 +296,7 @@ function ProxyFallbackField() {
|
|
|
295
296
|
mockaton.setProxyFallback(this.value.trim())
|
|
296
297
|
.then(parseError)
|
|
297
298
|
.then(updateState)
|
|
299
|
+
.then(() => focus(`.${CSS.FallbackBackend} input`))
|
|
298
300
|
.catch(onError)
|
|
299
301
|
}
|
|
300
302
|
return (
|
|
@@ -334,6 +336,7 @@ function ResetButton() {
|
|
|
334
336
|
mockaton.reset()
|
|
335
337
|
.then(parseError)
|
|
336
338
|
.then(updateState)
|
|
339
|
+
.then(() => focus(`.${CSS.ResetButton}`))
|
|
337
340
|
.catch(onError)
|
|
338
341
|
}
|
|
339
342
|
return (
|
|
@@ -708,14 +711,18 @@ function PayloadViewerProgressBar() {
|
|
|
708
711
|
r('div', { style: { animationDuration: state.delay + 'ms' } })))
|
|
709
712
|
}
|
|
710
713
|
|
|
711
|
-
function PayloadViewerTitle({ file,
|
|
712
|
-
const
|
|
714
|
+
function PayloadViewerTitle({ file, statusText }) {
|
|
715
|
+
const tokens = file.split('.')
|
|
716
|
+
const ext = tokens.pop()
|
|
717
|
+
const status = tokens.pop()
|
|
718
|
+
const urlAndMethod = '/' + tokens.join('.') + '.'
|
|
713
719
|
return (
|
|
714
720
|
r('span', null,
|
|
715
|
-
|
|
721
|
+
urlAndMethod,
|
|
716
722
|
r('abbr', { title: statusText }, status),
|
|
717
723
|
'.' + ext))
|
|
718
724
|
}
|
|
725
|
+
|
|
719
726
|
function PayloadViewerTitleWhenProxied({ mime, status, statusText, gatewayIsBad }) {
|
|
720
727
|
return (
|
|
721
728
|
r('span', null,
|
|
@@ -759,7 +766,6 @@ async function updatePayloadViewer(method, urlMask, response) {
|
|
|
759
766
|
}))
|
|
760
767
|
else
|
|
761
768
|
payloadViewerTitleRef.current.replaceChildren(PayloadViewerTitle({
|
|
762
|
-
status: response.status,
|
|
763
769
|
statusText: response.statusText,
|
|
764
770
|
file
|
|
765
771
|
}))
|
|
@@ -797,6 +803,9 @@ function mockSelectorFor(method, urlMask) {
|
|
|
797
803
|
return trFor(method, urlMask)?.querySelector(`select.${CSS.MockSelector}`)
|
|
798
804
|
}
|
|
799
805
|
|
|
806
|
+
function focus(selector) {
|
|
807
|
+
document.querySelector(selector)?.focus()
|
|
808
|
+
}
|
|
800
809
|
|
|
801
810
|
/** # Misc */
|
|
802
811
|
|