mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
fix(settings): hide the built-in type picker when setting up a plugin
The plugin Set up form reused the new-source editor, which always showed an Indexer type select listing only torznab and newznab. Changing it saved a torznab feed under the plugin's name, which is how a MyAnonaMouse feed ended up pointed at the tracker's website.
This commit is contained in:
@@ -727,7 +727,11 @@ function handleTestCurrent() {
|
||||
|
||||
<template #default>
|
||||
<SettingsSection :title="t('settings.system.requests.sections.connection')">
|
||||
<SettingsField v-if="draft.id === null" :label="t('settings.system.requests.indexers.fields.type')" input-id="indexer-type">
|
||||
<SettingsField
|
||||
v-if="draft.id === null && isBuiltInAdapter(draft.adapterType)"
|
||||
:label="t('settings.system.requests.indexers.fields.type')"
|
||||
input-id="indexer-type"
|
||||
>
|
||||
<template #default="{ describedBy }">
|
||||
<select
|
||||
id="indexer-type"
|
||||
|
||||
@@ -695,6 +695,16 @@ describe('RequestIndexersPanel', () => {
|
||||
expect(sheet().querySelector<HTMLInputElement>('#indexer-name')?.value).toBe('Demo Tracker')
|
||||
})
|
||||
|
||||
/** The plugin already settles the type, and switching it here would save a torznab feed under the plugin's name. */
|
||||
it('does not offer the built-in type picker when setting up a plugin', async () => {
|
||||
const wrapper = await mountPanel({ adapters: [descriptor(), PLUGIN] })
|
||||
|
||||
await clickInPanel(wrapper, 'Set up')
|
||||
|
||||
expect(sheet().querySelector('#indexer-name')).not.toBeNull()
|
||||
expect(sheet().querySelector('#indexer-type')).toBeNull()
|
||||
})
|
||||
|
||||
/** Once something uses it, it is that source, and a second row for it would be a duplicate. */
|
||||
it('stops listing it separately once a source uses it', async () => {
|
||||
const wrapper = await mountPanel({
|
||||
|
||||
Reference in New Issue
Block a user