mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-09 16:10:33 +03:00
Fix quickstart default checked of conditional fields [ci skip]
This commit is contained in:
parent
2320791f6d
commit
12d3d0fedd
|
@ -105,12 +105,13 @@ const Quickstart = ({
|
||||||
multiple,
|
multiple,
|
||||||
other,
|
other,
|
||||||
help,
|
help,
|
||||||
|
hidden,
|
||||||
}) => {
|
}) => {
|
||||||
// Optional function that's called with the value
|
// Optional function that's called with the value
|
||||||
const setterFunc = setters[id] || (() => {})
|
const setterFunc = setters[id] || (() => {})
|
||||||
// Check if dropdown should be shown
|
// Check if dropdown should be shown
|
||||||
const dropdownGetter = showDropdown[id] || (() => true)
|
const dropdownGetter = showDropdown[id] || (() => true)
|
||||||
return (
|
return hidden ? null : (
|
||||||
<div key={id} data-quickstart-group={id} className={classes.group}>
|
<div key={id} data-quickstart-group={id} className={classes.group}>
|
||||||
<style data-quickstart-style={id} scoped>
|
<style data-quickstart-style={id} scoped>
|
||||||
{styles[id] ||
|
{styles[id] ||
|
||||||
|
|
|
@ -115,7 +115,9 @@ export default function QuickstartTraining({ id, title, download = 'base_config.
|
||||||
}))
|
}))
|
||||||
.sort((a, b) => a.title.localeCompare(b.title))
|
.sort((a, b) => a.title.localeCompare(b.title))
|
||||||
if (!_components.includes('textcat')) {
|
if (!_components.includes('textcat')) {
|
||||||
data = data.filter(({ id }) => id !== 'textcat')
|
data = data.map(field =>
|
||||||
|
field.id === 'textcat' ? { ...field, hidden: true } : field
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Quickstart
|
<Quickstart
|
||||||
|
|
Loading…
Reference in New Issue
Block a user