feat: some changes
This commit is contained in:
+63
-24
@@ -1244,18 +1244,14 @@
|
|||||||
></q-btn>
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div v-if="currentFundingSource" class="q-mt-sm">
|
||||||
v-if="currentFundingSource && currentFundingSource.skip"
|
<q-checkbox
|
||||||
class="pill-row q-mt-sm"
|
v-model="currentFundingSourceSkip"
|
||||||
>
|
|
||||||
<q-chip
|
|
||||||
dense
|
dense
|
||||||
square
|
|
||||||
color="warning"
|
color="warning"
|
||||||
text-color="white"
|
keep-color
|
||||||
>
|
label="Skip this funding source"
|
||||||
Skipped by wallet config
|
></q-checkbox>
|
||||||
</q-chip>
|
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
@@ -1516,6 +1512,17 @@
|
|||||||
></q-btn>
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="testMockItemHasSkip(item)" class="q-mb-md">
|
||||||
|
<q-checkbox
|
||||||
|
:model-value="testMockItemSkip(item)"
|
||||||
|
dense
|
||||||
|
color="warning"
|
||||||
|
keep-color
|
||||||
|
label="Skip this mock definition"
|
||||||
|
@update:model-value="setTestMockItemSkip(testEntry, mockSet, item, $event)"
|
||||||
|
></q-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
:id="`test-mock-definition-${group.key}-${testEntry.index}-${mockSetIndex}-${bindingIndex}-${itemIndex}`"
|
:id="`test-mock-definition-${group.key}-${testEntry.index}-${mockSetIndex}-${bindingIndex}-${itemIndex}`"
|
||||||
v-model="item.text"
|
v-model="item.text"
|
||||||
@@ -1611,15 +1618,6 @@
|
|||||||
|
|
||||||
<q-card-section class="q-pa-lg">
|
<q-card-section class="q-pa-lg">
|
||||||
<div v-if="currentFundingSource">
|
<div v-if="currentFundingSource">
|
||||||
<div class="q-mb-lg">
|
|
||||||
<q-checkbox
|
|
||||||
v-model="currentFundingSourceSkip"
|
|
||||||
label="Skip this funding source in generated wallet tests"
|
|
||||||
color="warning"
|
|
||||||
keep-color
|
|
||||||
></q-checkbox>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-editor" v-if="currentFundingSourceSettingRows.length">
|
<div class="settings-editor" v-if="currentFundingSourceSettingRows.length">
|
||||||
<div class="settings-table">
|
<div class="settings-table">
|
||||||
<div class="settings-table-header settings-table-grid">
|
<div class="settings-table-header settings-table-grid">
|
||||||
@@ -2566,11 +2564,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value) {
|
fundingSource.skip = Boolean(value)
|
||||||
fundingSource.skip = true
|
|
||||||
} else {
|
|
||||||
delete fundingSource.skip
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
preserveSettingsDrafts: true,
|
preserveSettingsDrafts: true,
|
||||||
@@ -2998,6 +2992,51 @@
|
|||||||
|
|
||||||
return `Test Mock Definition ${itemIndex + 1}`
|
return `Test Mock Definition ${itemIndex + 1}`
|
||||||
},
|
},
|
||||||
|
testMockItemHasSkip(item) {
|
||||||
|
const parsed = parseJsonText(item?.text || '')
|
||||||
|
|
||||||
|
return (
|
||||||
|
parsed.ok &&
|
||||||
|
isPlainObject(parsed.data) &&
|
||||||
|
typeof parsed.data.skip === 'boolean'
|
||||||
|
)
|
||||||
|
},
|
||||||
|
testMockItemSkip(item) {
|
||||||
|
const parsed = parseJsonText(item?.text || '')
|
||||||
|
|
||||||
|
if (
|
||||||
|
!parsed.ok ||
|
||||||
|
!isPlainObject(parsed.data) ||
|
||||||
|
typeof parsed.data.skip !== 'boolean'
|
||||||
|
) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return parsed.data.skip
|
||||||
|
},
|
||||||
|
setTestMockItemSkip(testEntry, mockSet, item, value) {
|
||||||
|
const parsed = parseJsonText(item?.text || '')
|
||||||
|
|
||||||
|
if (
|
||||||
|
!parsed.ok ||
|
||||||
|
!isPlainObject(parsed.data) ||
|
||||||
|
typeof parsed.data.skip !== 'boolean'
|
||||||
|
) {
|
||||||
|
item.error =
|
||||||
|
'Could not update skip because this mock definition is not valid JSON with a boolean skip field.'
|
||||||
|
this.notify(
|
||||||
|
'Could not save mock skip flag.',
|
||||||
|
'negative',
|
||||||
|
item.error
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
item.error = ''
|
||||||
|
parsed.data.skip = Boolean(value)
|
||||||
|
item.text = safeStringify(parsed.data)
|
||||||
|
this.persistTestMockSet(testEntry, mockSet)
|
||||||
|
},
|
||||||
addTestMockBinding(testEntry, mockSet) {
|
addTestMockBinding(testEntry, mockSet) {
|
||||||
mockSet.bindings.push(
|
mockSet.bindings.push(
|
||||||
this.createTestMockBindingDraft(
|
this.createTestMockBindingDraft(
|
||||||
|
|||||||
Reference in New Issue
Block a user