From 4d1eb970cec2f6a0d14cdc80bc98c13482c31225 Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 12 Sep 2017 17:34:46 +0900 Subject: [PATCH] fixed auth_crawler by select_type --- .../react/components/CrawlerAuthInputs.tsx | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/ts/@overflow/meta/react/components/CrawlerAuthInputs.tsx b/src/ts/@overflow/meta/react/components/CrawlerAuthInputs.tsx index 40db7aa..1af5b66 100644 --- a/src/ts/@overflow/meta/react/components/CrawlerAuthInputs.tsx +++ b/src/ts/@overflow/meta/react/components/CrawlerAuthInputs.tsx @@ -47,9 +47,9 @@ export class CrawlerAuthInputs extends React.Component, nextContext: any): void { - if(nextProps.metaCrawlerInputItemList !== this.props.metaCrawlerInputItemList) { - this.setState({authJson: {}}); - } + if (nextProps.metaCrawlerInputItemList !== this.props.metaCrawlerInputItemList) { + this.setState({ authJson: {} }); + } } @@ -96,8 +96,8 @@ export class CrawlerAuthInputs extends React.Component, data: InputOnChangeData) => { this.onChangeAuth(item.name, data.value); }} />); - } else if (item.inputType.name === 'Radio') { + } else if (item.inputType.name === 'SELECT_TYPE') { let itemValues = item.keyValue.split('|'); let idx = 0; - for (let itemValue of itemValues) { - elem.push(, data: CheckboxProps) => { - this.onChangeAuth(item.name, itemValue); - } - } - />); + elem.push(); + + if(this.state.authJson[item.name] === undefined) { + this.onChangeAuth(item.name, item.defaultValue); } + + for (let itemValue of itemValues) { + elem.push( + , data: CheckboxProps) => { + this.onChangeAuth(item.name, itemValue); + } + } + />); + } } return (