aboutsummaryrefslogtreecommitdiff
path: root/src/settings/components/index.tsx
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-10-09 11:50:52 +0000
committerGitHub <noreply@github.com>2019-10-09 11:50:52 +0000
commit18c72bf15c6bc7e4c88dd06d38ff861f29d66b1b (patch)
treef46720349e17c57db7bbfc55241b12c4410f2773 /src/settings/components/index.tsx
parent8eddcc1785a85bbe74be254d1055ebe5125dad10 (diff)
parent68f6211aac4177f3a70a40031dabbd1b61840071 (diff)
Merge pull request #655 from ueokande/partial-blacklist
Partial blacklist
Diffstat (limited to 'src/settings/components/index.tsx')
-rw-r--r--src/settings/components/index.tsx16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/settings/components/index.tsx b/src/settings/components/index.tsx
index 160dd9c..3eb2dbe 100644
--- a/src/settings/components/index.tsx
+++ b/src/settings/components/index.tsx
@@ -6,6 +6,7 @@ import SearchForm from './form/SearchForm';
import KeymapsForm from './form/KeymapsForm';
import BlacklistForm from './form/BlacklistForm';
import PropertiesForm from './form/PropertiesForm';
+import PartialBlacklistForm from './form/PartialBlacklistForm';
import * as settingActions from '../../settings/actions/setting';
import SettingData, {
FormKeymaps, FormSearch, FormSettings, JSONTextSettings,
@@ -53,7 +54,15 @@ class SettingsComponent extends React.Component<Props> {
<fieldset>
<legend>Blacklist</legend>
<BlacklistForm
- value={form.blacklist.toJSON()}
+ value={form.blacklist}
+ onChange={this.bindBlacklistForm.bind(this)}
+ onBlur={this.save.bind(this)}
+ />
+ </fieldset>
+ <fieldset>
+ <legend>Partial blacklist</legend>
+ <PartialBlacklistForm
+ value={form.blacklist}
onChange={this.bindBlacklistForm.bind(this)}
onBlur={this.save.bind(this)}
/>
@@ -138,11 +147,10 @@ class SettingsComponent extends React.Component<Props> {
this.props.dispatch(settingActions.set(data));
}
- bindBlacklistForm(value: any) {
+ bindBlacklistForm(blacklist: Blacklist) {
let data = new SettingData({
source: this.props.source,
- form: (this.props.form as FormSettings).buildWithBlacklist(
- Blacklist.fromJSON(value)),
+ form: (this.props.form as FormSettings).buildWithBlacklist(blacklist),
});
this.props.dispatch(settingActions.set(data));
}