@@ -5,6 +5,7 @@ import queryString from 'query-string';
55import Hypertopic from 'hypertopic' ;
66import conf from '../../config.js' ;
77import Viewpoint from './Viewpoint.jsx' ;
8+ import AttributeSearch from './AttributeSearch.jsx' ;
89import Corpora from './Corpora.jsx' ;
910import Header from '../Header.jsx' ;
1011import Status from './Status.jsx' ;
@@ -20,6 +21,7 @@ class Portfolio extends Component {
2021 super ( ) ;
2122 this . state = {
2223 viewpoints : [ ] ,
24+ attributes : [ ] ,
2325 corpora : [ ] ,
2426 items : [ ] ,
2527 selectedItems : [ ] ,
@@ -42,6 +44,7 @@ class Portfolio extends Component {
4244 . map ( ( [ key , value ] ) => key . concat ( ' : ' , value ) )
4345 . map ( x => ( { [ x ] : { name : x } } ) ) ;
4446 let candidates = this . state . viewpoints . concat ( attributes ) ;
47+ let attributesSearch = this . _getAttributes ( ) ;
4548 const urlParams = new URLSearchParams ( window . location . search ) ;
4649 const selectionJSON = JSON . parse ( urlParams . get ( 't' ) ) ;
4750 // Normal items have numbers in their names, but building maps don't,
@@ -70,6 +73,12 @@ class Portfolio extends Component {
7073 < div className = "container-fluid" >
7174 < div className = "App-content row" >
7275 < div className = "col-md-4 p-4 d-none d-sm-block" >
76+ < div className = "AttributesSearch" >
77+ < h2 className = "h4 font-weight-bold text-center" > < Trans > Attributs</ Trans > </ h2 >
78+ < div className = "p-3" >
79+ { attributesSearch }
80+ </ div >
81+ </ div >
7382 < div className = "Description" >
7483 < h2 className = "h4 font-weight-bold text-center" > < Trans > Points de vue</ Trans > </ h2 >
7584 < div className = "p-3" >
@@ -252,6 +261,12 @@ class Portfolio extends Component {
252261 ) ;
253262 }
254263
264+ _getAttributes ( ) {
265+ let attributesKeys = new Items ( this . state . items )
266+ . getAttributeKeys ( ) ;
267+ return attributesKeys . map ( key => < AttributeSearch key = { key } name = { key } items = { this . state . items } query = { this . query } history = { this . history } /> ) ;
268+ }
269+
255270 _getCorpora ( ) {
256271 let ids = this . state . corpora . map ( c => c . id ) ;
257272 return (
0 commit comments