Add menu to response heades
This commit is contained in:
parent
d2622a6c4f
commit
fc719eda27
|
@ -28,6 +28,7 @@
|
||||||
export let valueHeading
|
export let valueHeading
|
||||||
export let tooltip
|
export let tooltip
|
||||||
export let menuItems
|
export let menuItems
|
||||||
|
export let showMenu = false
|
||||||
|
|
||||||
let fields = Object.entries(object).map(([name, value]) => ({ name, value }))
|
let fields = Object.entries(object).map(([name, value]) => ({ name, value }))
|
||||||
let fieldActivity = buildFieldActivity(activity)
|
let fieldActivity = buildFieldActivity(activity)
|
||||||
|
@ -90,8 +91,9 @@
|
||||||
<div
|
<div
|
||||||
class="container"
|
class="container"
|
||||||
class:container-active={toggle}
|
class:container-active={toggle}
|
||||||
class:container-menu={menuItems}
|
class:container-menu={showMenu}
|
||||||
class:readOnly
|
class:readOnly
|
||||||
|
class:readOnly-menu={readOnly && showMenu}
|
||||||
>
|
>
|
||||||
{#each fields as field, idx}
|
{#each fields as field, idx}
|
||||||
<Input
|
<Input
|
||||||
|
@ -116,7 +118,7 @@
|
||||||
{#if !readOnly}
|
{#if !readOnly}
|
||||||
<Icon hoverable name="Close" on:click={() => deleteEntry(idx)} />
|
<Icon hoverable name="Close" on:click={() => deleteEntry(idx)} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if menuItems?.length > 0 && !readOnly}
|
{#if menuItems?.length > 0 && showMenu}
|
||||||
<ActionMenu>
|
<ActionMenu>
|
||||||
<div slot="control" class="icon">
|
<div slot="control" class="icon">
|
||||||
<Icon size="S" hoverable name="MoreSmallList" />
|
<Icon size="S" hoverable name="MoreSmallList" />
|
||||||
|
@ -156,4 +158,7 @@
|
||||||
.readOnly {
|
.readOnly {
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
}
|
}
|
||||||
|
.readOnly-menu {
|
||||||
|
grid-template-columns: 1fr 1fr 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -220,6 +220,14 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
const responseHeadersMenuItems = [
|
||||||
|
{
|
||||||
|
text: "Create dynamic variable",
|
||||||
|
onClick: () => {
|
||||||
|
console.log("create variable")
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
query = getSelectedQuery()
|
query = getSelectedQuery()
|
||||||
|
@ -398,6 +406,7 @@
|
||||||
headings
|
headings
|
||||||
options={SchemaTypeOptions}
|
options={SchemaTypeOptions}
|
||||||
menuItems={schemaMenuItems}
|
menuItems={schemaMenuItems}
|
||||||
|
showMenu={!schemaReadOnly}
|
||||||
readOnly={schemaReadOnly}
|
readOnly={schemaReadOnly}
|
||||||
/>
|
/>
|
||||||
</Tab>
|
</Tab>
|
||||||
|
@ -407,7 +416,12 @@
|
||||||
<TextArea disabled value={response.extra?.raw} height="300" />
|
<TextArea disabled value={response.extra?.raw} height="300" />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab title="Headers">
|
<Tab title="Headers">
|
||||||
<KeyValueBuilder object={response.extra?.headers} readOnly />
|
<KeyValueBuilder
|
||||||
|
object={response.extra?.headers}
|
||||||
|
readOnly
|
||||||
|
menuItems={responseHeadersMenuItems}
|
||||||
|
showMenu={true}
|
||||||
|
/>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab title="Preview">
|
<Tab title="Preview">
|
||||||
<div class="table">
|
<div class="table">
|
||||||
|
|
Loading…
Reference in New Issue