From ab930ee2eb442d439a59cfc71acad1130d9b0a4b Mon Sep 17 00:00:00 2001 From: Malar Kannan Date: Wed, 19 Jul 2017 18:02:46 +0530 Subject: [PATCH] updated preview and using freespeech_walle as submodule --- .gitignore | 1 - .gitmodules | 3 +++ freespeech_walle | 1 + package-lock.json | 11 +++++++++++ package.json | 2 ++ requirements.txt | 16 ++++++++++++++++ src/LexEdit.tsx | 24 +++++++++++++++--------- src/LexSetup.tsx | 2 +- src/LexSingleInput.tsx | 2 +- 9 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 .gitmodules create mode 160000 freespeech_walle diff --git a/.gitignore b/.gitignore index 986f656..a8a40ef 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ yarn-error.log* public/png *.xml -freespeech_walle # Created by https://www.gitignore.io/api/python diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..089d88a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "freespeech_walle"] + path = freespeech_walle + url = https://github.com/inventionlabs/freespeech-wall-e.git diff --git a/freespeech_walle b/freespeech_walle new file mode 160000 index 0000000..260e957 --- /dev/null +++ b/freespeech_walle @@ -0,0 +1 @@ +Subproject commit 260e957355a70da04306b05661f23358b4e8ea39 diff --git a/package-lock.json b/package-lock.json index d34a97c..4bb91d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,12 @@ "integrity": "sha512-Xo99Pb3nQhDpnlOMBNkqse1Wj1C0ODoP/fnaM074YXDtwppIiaG3Nm7+b/VYKsIEhitH8o46/eDm51j+jG8EFw==", "dev": true }, + "@types/react-sortable-hoc": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/react-sortable-hoc/-/react-sortable-hoc-0.6.0.tgz", + "integrity": "sha512-qOWavACyVKEASlqAy0qAvszIOz5GIDW5cdAcMaTl9rge30JHIvynTnOQJFzl+HmxPiEmTuz4gipiNoBjbnP3kQ==", + "dev": true + }, "@types/react-transition-group": { "version": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-1.1.0.tgz", "integrity": "sha1-GexL+hyxgJ7LxFmdDDjS6f+xm/4=", @@ -3638,6 +3644,11 @@ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.5.tgz", "integrity": "sha1-+OjHsjlCJXblLWt9sGQ5RpvphGo=" }, + "react-sortable-hoc": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/react-sortable-hoc/-/react-sortable-hoc-0.6.5.tgz", + "integrity": "sha1-5rXUFEdtUaC2IZMSmIVdT9YIwic=" + }, "react-transition-group": { "version": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-1.2.0.tgz", "integrity": "sha1-tR/JIbDDg1p+98Vxx5/ILHPpIE8=" diff --git a/package.json b/package.json index 623fd8b..c3850f2 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "react-addons-css-transition-group": "^15.5.2", "react-dom": "^15.5.4", "react-redux": "^5.0.5", + "react-sortable-hoc": "^0.6.5", "react-transition-group": "^1.1.3", "reflexbox": "^3.0.0-0", "semantic-ui-css": "^2.2.10", @@ -26,6 +27,7 @@ "@types/react-addons-css-transition-group": "^15.0.2", "@types/react-dom": "^15.5.0", "@types/react-redux": "^4.4.46", + "@types/react-sortable-hoc": "^0.6.0", "@types/react-transition-group": "^1.1.0", "@types/xml2js": "0.0.33", "app-root-path": "^2.0.1", diff --git a/requirements.txt b/requirements.txt index 6aee249..8c0dad8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,22 @@ +beautifulsoup4==4.6.0 +bs4==0.0.1 +certifi==2017.4.17 +chardet==3.0.4 click==6.7 Flask==0.12.2 +Flask-Cors==3.0.3 +Flask-Webpack==0.1.0 +idna==2.5 itsdangerous==0.24 Jinja2==2.9.6 +lxml==3.8.0 MarkupSafe==1.0 +nltk==3.2.4 +Pattern==2.6 +pytz==2017.2 +requests==2.18.1 +six==1.10.0 +urllib3==1.21.1 Werkzeug==0.12.2 +xlrd==1.0.0 +xlwt==1.2.0 diff --git a/src/LexEdit.tsx b/src/LexEdit.tsx index 1a223aa..aab636e 100644 --- a/src/LexEdit.tsx +++ b/src/LexEdit.tsx @@ -43,15 +43,21 @@ export class LexEdit extends React.Component { this.handleOnChange(eventData); }; let params = { field, sh, defaultText, options, langSelOpts, changed }; - if (this.props.fieldMetaMap[field].type === 'text') { - return textInput(params); - } else if (this.props.fieldMetaMap[field].type === 'select') { - return selectInput(params); - } else if (this.props.fieldMetaMap[field].type === 'preview') { - return imagePreview(params); - } else { - console.log('field discarded :', field); - return null; + switch (fieldMeta.type) { + case 'text': { + return textInput(params); + } + case 'select': { + return selectInput(params); + } + case 'preview': { + return imagePreview(params); + } + default: { + console.log('type discarded :', fieldMeta.type); + console.log('values discarded :', fieldMeta.get(li)); + return null; + } } }); return ( diff --git a/src/LexSetup.tsx b/src/LexSetup.tsx index 1028511..c50583b 100644 --- a/src/LexSetup.tsx +++ b/src/LexSetup.tsx @@ -27,7 +27,7 @@ const fieldMetaMap = { synset: { type: 'text', ...simpleAccessor('lexprops[0].wnsynset[0]'), }, guid: { type: 'text', ...simpleAccessor('guid[0]'), }, pos: { type: 'select', ...simpleAccessor('pos[0]'), }, - image: { type: 'text', ...simpleAccessor('image[0]'), }, + image: { type: 'preview', ...simpleAccessor('image[0]'), }, relations: { type: 'text', ...simpleAccessor('relations[0]'), }, frame: { type: 'select', ...simpleAccessor('syntacticprops[0].property[0]._'), }, morphclass: { diff --git a/src/LexSingleInput.tsx b/src/LexSingleInput.tsx index 99e7d0b..1ead828 100644 --- a/src/LexSingleInput.tsx +++ b/src/LexSingleInput.tsx @@ -86,5 +86,5 @@ export function imagePreview(params: any) { - ) : null; + ) : textInput(params); }