diff --git a/src/App.js b/src/App.js index d6350dcb..cea86908 100644 --- a/src/App.js +++ b/src/App.js @@ -13,7 +13,8 @@ import {IndeterminateProgressOverlay} from './components'; const App = () => { const dispatch = useDispatch(); - const appStore = useSelector(state => state.app); + const appStore = useSelector(state => state); + console.log(appStore) const [translationTokens, setTranslationTokens] = useState(); useEffect( diff --git a/src/constants/index.js b/src/constants/index.js index 5535527a..68a75fa7 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -1,5 +1,5 @@ export default { - API_HOST: 'localhost:4010', + API_HOST: 'localhost:3000/v1/', MAX_TABLE_SIZE: 10, HEADER_HEIGHT: 64, // Needed to be used to calculate max height for body components THEME: { diff --git a/src/mocks/co-benefits.json b/src/mocks/co-benefits.json new file mode 100644 index 00000000..6f7794c2 --- /dev/null +++ b/src/mocks/co-benefits.json @@ -0,0 +1,17 @@ +[[ + { + "cobenifet": "TEST_COBENIFET_1" + }, + { + "cobenifet": "TEST_COBENIFET_2" + }, + { + "cobenifet": "TEST_COBENIFET_3" + }, + { + "cobenifet": "TEST_COBENIFET_4" + }, + { + "cobenifet": "TEST_COBENIFET_5" + } + ]] diff --git a/src/mocks/index.js b/src/mocks/index.js index 0547248e..6ac55925 100644 --- a/src/mocks/index.js +++ b/src/mocks/index.js @@ -1 +1,4 @@ export * as mockedRetiredTokenResponse from './retired-tokens.json'; +export * as projectRatingResponseStub from './project-ratings.json'; +export * as coBenefitResponseStub from './co-benefits.json'; +export * as qualificationsResponseStub from './qualifications.json'; \ No newline at end of file diff --git a/src/mocks/project-ratings.json b/src/mocks/project-ratings.json new file mode 100644 index 00000000..3cb94f21 --- /dev/null +++ b/src/mocks/project-ratings.json @@ -0,0 +1,182 @@ +[ + { + "type": "Oberbrunner and Sons", + "rating": 32, + "link": "http://sourceforge.net/suspendisse.aspx?lacus=at&morbi=velit&quis=eu&tortor=est&id=congue&nulla=elementum&ultrices=in&aliquet=hac&maecenas=habitasse&leo=platea&odio=dictumst&condimentum=morbi&id=vestibulum&luctus=velit&nec=id&molestie=pretium&sed=iaculis&justo=diam&pellentesque=erat&viverra=fermentum&pede=justo&ac=nec&diam=condimentum&cras=neque&pellentesque=sapien&volutpat=placerat&dui=ante&maecenas=nulla&tristique=justo&est=aliquam&et=quis&tempus=turpis&semper=eget&est=elit&quam=sodales&pharetra=scelerisque&magna=mauris&ac=sit&consequat=amet&metus=eros&sapien=suspendisse&ut=accumsan&nunc=tortor&vestibulum=quis&ante=turpis&ipsum=sed&primis=ante&in=vivamus&faucibus=tortor&orci=duis&luctus=mattis&et=egestas&ultrices=metus&posuere=aenean&cubilia=fermentum&curae=donec&mauris=ut&viverra=mauris&diam=eget&vitae=massa&quam=tempor&suspendisse=convallis&potenti=nulla&nullam=neque&porttitor=libero&lacus=convallis", + "scale": 1 + }, + { + "type": "Shanahan-Anderson", + "rating": 20, + "link": "http://woothemes.com/auctor.aspx?in=ridiculus&magna=mus&bibendum=vivamus&imperdiet=vestibulum&nullam=sagittis&orci=sapien&pede=cum&venenatis=sociis&non=natoque&sodales=penatibus&sed=et&tincidunt=magnis&eu=dis&felis=parturient&fusce=montes&posuere=nascetur&felis=ridiculus&sed=mus&lacus=etiam&morbi=vel&sem=augue&mauris=vestibulum&laoreet=rutrum&ut=rutrum&rhoncus=neque&aliquet=aenean&pulvinar=auctor&sed=gravida&nisl=sem&nunc=praesent&rhoncus=id&dui=massa&vel=id&sem=nisl&sed=venenatis&sagittis=lacinia&nam=aenean&congue=sit&risus=amet&semper=justo&porta=morbi&volutpat=ut&quam=odio&pede=cras&lobortis=mi&ligula=pede&sit=malesuada&amet=in&eleifend=imperdiet&pede=et&libero=commodo&quis=vulputate&orci=justo&nullam=in&molestie=blandit&nibh=ultrices&in=enim&lectus=lorem&pellentesque=ipsum&at=dolor&nulla=sit&suspendisse=amet&potenti=consectetuer&cras=adipiscing&in=elit&purus=proin&eu=interdum&magna=mauris&vulputate=non&luctus=ligula&cum=pellentesque&sociis=ultrices&natoque=phasellus&penatibus=id&et=sapien&magnis=in&dis=sapien&parturient=iaculis&montes=congue&nascetur=vivamus", + "scale": 2 + }, + { + "type": "Hauck-Wehner", + "rating": 29, + "link": "http://abc.net.au/mauris/viverra/diam.aspx?semper=ultrices&interdum=posuere&mauris=cubilia&ullamcorper=curae&purus=duis&sit=faucibus&amet=accumsan&nulla=odio&quisque=curabitur&arcu=convallis&libero=duis&rutrum=consequat&ac=dui", + "scale": 3 + }, + { + "type": "Watsica and Sons", + "rating": 31, + "link": "http://ovh.net/nunc.aspx?eleifend=pellentesque&quam=at&a=nulla&odio=suspendisse&in=potenti&hac=cras", + "scale": 4 + }, + { + "type": "Stamm Group", + "rating": 39, + "link": "http://seesaa.net/vehicula/consequat/morbi/a/ipsum/integer.jpg?in=vel&quis=pede&justo=morbi&maecenas=porttitor&rhoncus=lorem&aliquam=id&lacus=ligula&morbi=suspendisse&quis=ornare&tortor=consequat&id=lectus&nulla=in&ultrices=est&aliquet=risus&maecenas=auctor&leo=sed&odio=tristique&condimentum=in&id=tempus&luctus=sit&nec=amet&molestie=sem&sed=fusce&justo=consequat&pellentesque=nulla&viverra=nisl&pede=nunc&ac=nisl&diam=duis&cras=bibendum&pellentesque=felis&volutpat=sed&dui=interdum&maecenas=venenatis&tristique=turpis&est=enim&et=blandit&tempus=mi&semper=in&est=porttitor&quam=pede&pharetra=justo&magna=eu&ac=massa&consequat=donec&metus=dapibus&sapien=duis&ut=at&nunc=velit&vestibulum=eu&ante=est&ipsum=congue&primis=elementum&in=in&faucibus=hac&orci=habitasse", + "scale": 5 + }, + { + "type": "Hirthe-Macejkovic", + "rating": 46, + "link": "https://icq.com/at.xml?et=ac&commodo=nulla&vulputate=sed&justo=vel&in=enim&blandit=sit&ultrices=amet&enim=nunc&lorem=viverra&ipsum=dapibus&dolor=nulla&sit=suscipit&amet=ligula&consectetuer=in&adipiscing=lacus&elit=curabitur&proin=at&interdum=ipsum&mauris=ac&non=tellus&ligula=semper&pellentesque=interdum&ultrices=mauris&phasellus=ullamcorper&id=purus&sapien=sit&in=amet&sapien=nulla&iaculis=quisque&congue=arcu&vivamus=libero&metus=rutrum&arcu=ac&adipiscing=lobortis&molestie=vel&hendrerit=dapibus&at=at&vulputate=diam&vitae=nam&nisl=tristique&aenean=tortor&lectus=eu&pellentesque=pede", + "scale": 6 + }, + { + "type": "Murphy, Champlin and Wunsch", + "rating": 14, + "link": "http://house.gov/magna/at/nunc.js?fusce=sem&posuere=praesent&felis=id&sed=massa&lacus=id&morbi=nisl&sem=venenatis&mauris=lacinia&laoreet=aenean&ut=sit&rhoncus=amet&aliquet=justo&pulvinar=morbi&sed=ut&nisl=odio&nunc=cras&rhoncus=mi&dui=pede&vel=malesuada&sem=in&sed=imperdiet&sagittis=et&nam=commodo&congue=vulputate&risus=justo&semper=in&porta=blandit&volutpat=ultrices&quam=enim&pede=lorem&lobortis=ipsum&ligula=dolor&sit=sit&amet=amet&eleifend=consectetuer&pede=adipiscing&libero=elit&quis=proin&orci=interdum&nullam=mauris&molestie=non&nibh=ligula&in=pellentesque&lectus=ultrices&pellentesque=phasellus&at=id&nulla=sapien&suspendisse=in&potenti=sapien&cras=iaculis&in=congue&purus=vivamus&eu=metus&magna=arcu&vulputate=adipiscing&luctus=molestie&cum=hendrerit&sociis=at&natoque=vulputate", + "scale": 7 + }, + { + "type": "Pacocha-Grady", + "rating": 12, + "link": "http://wikia.com/arcu/libero/rutrum/ac/lobortis/vel/dapibus.json?ultrices=leo&phasellus=rhoncus&id=sed&sapien=vestibulum&in=sit", + "scale": 8 + }, + { + "type": "Maggio, Braun and Wolff", + "rating": 97, + "link": "http://tmall.com/lorem/vitae.json?in=pede&hac=ac&habitasse=diam&platea=cras&dictumst=pellentesque&etiam=volutpat&faucibus=dui&cursus=maecenas&urna=tristique&ut=est&tellus=et&nulla=tempus&ut=semper&erat=est&id=quam&mauris=pharetra&vulputate=magna&elementum=ac&nullam=consequat&varius=metus&nulla=sapien&facilisi=ut&cras=nunc&non=vestibulum&velit=ante&nec=ipsum&nisi=primis&vulputate=in&nonummy=faucibus&maecenas=orci&tincidunt=luctus&lacus=et&at=ultrices&velit=posuere&vivamus=cubilia&vel=curae&nulla=mauris&eget=viverra&eros=diam&elementum=vitae&pellentesque=quam&quisque=suspendisse&porta=potenti&volutpat=nullam&erat=porttitor&quisque=lacus&erat=at&eros=turpis&viverra=donec&eget=posuere&congue=metus&eget=vitae&semper=ipsum&rutrum=aliquam&nulla=non&nunc=mauris&purus=morbi&phasellus=non&in=lectus&felis=aliquam&donec=sit&semper=amet&sapien=diam&a=in&libero=magna&nam=bibendum&dui=imperdiet&proin=nullam&leo=orci&odio=pede&porttitor=venenatis&id=non&consequat=sodales&in=sed&consequat=tincidunt&ut=eu", + "scale": 9 + }, + { + "type": "Klocko-Kihn", + "rating": 25, + "link": "https://jalbum.net/mauris/eget/massa/tempor/convallis.html?porttitor=aliquam&pede=non&justo=mauris&eu=morbi&massa=non&donec=lectus&dapibus=aliquam&duis=sit&at=amet&velit=diam&eu=in&est=magna&congue=bibendum&elementum=imperdiet&in=nullam&hac=orci&habitasse=pede&platea=venenatis&dictumst=non&morbi=sodales&vestibulum=sed&velit=tincidunt&id=eu&pretium=felis&iaculis=fusce&diam=posuere&erat=felis&fermentum=sed&justo=lacus&nec=morbi&condimentum=sem&neque=mauris&sapien=laoreet&placerat=ut&ante=rhoncus&nulla=aliquet&justo=pulvinar&aliquam=sed&quis=nisl&turpis=nunc&eget=rhoncus&elit=dui&sodales=vel&scelerisque=sem&mauris=sed&sit=sagittis&amet=nam&eros=congue&suspendisse=risus&accumsan=semper&tortor=porta&quis=volutpat&turpis=quam&sed=pede&ante=lobortis&vivamus=ligula&tortor=sit&duis=amet&mattis=eleifend&egestas=pede&metus=libero&aenean=quis&fermentum=orci&donec=nullam&ut=molestie&mauris=nibh&eget=in&massa=lectus&tempor=pellentesque&convallis=at", + "scale": 10 + }, + { + "type": "Bauch, Bogan and Jenkins", + "rating": 96, + "link": "http://clickbank.net/cras/in/purus/eu/magna/vulputate/luctus.aspx?aenean=aliquet&sit=pulvinar&amet=sed&justo=nisl&morbi=nunc&ut=rhoncus&odio=dui", + "scale": 11 + }, + { + "type": "Daugherty Inc", + "rating": 63, + "link": "http://tripadvisor.com/nonummy/integer/non.jpg?non=etiam&sodales=justo&sed=etiam&tincidunt=pretium&eu=iaculis&felis=justo&fusce=in&posuere=hac&felis=habitasse&sed=platea&lacus=dictumst&morbi=etiam&sem=faucibus&mauris=cursus&laoreet=urna&ut=ut&rhoncus=tellus&aliquet=nulla&pulvinar=ut&sed=erat&nisl=id&nunc=mauris", + "scale": 12 + }, + { + "type": "Marvin, Klein and Bogan", + "rating": 56, + "link": "https://amazon.co.uk/mauris/laoreet/ut.xml?dis=vestibulum&parturient=eget&montes=vulputate&nascetur=ut&ridiculus=ultrices&mus=vel&etiam=augue&vel=vestibulum&augue=ante&vestibulum=ipsum&rutrum=primis&rutrum=in", + "scale": 13 + }, + { + "type": "Block, Strosin and Schiller", + "rating": 12, + "link": "https://networksolutions.com/elementum/ligula/vehicula/consequat/morbi/a.xml?posuere=neque&cubilia=duis&curae=bibendum&mauris=morbi&viverra=non&diam=quam&vitae=nec&quam=dui&suspendisse=luctus&potenti=rutrum&nullam=nulla&porttitor=tellus&lacus=in&at=sagittis&turpis=dui&donec=vel&posuere=nisl&metus=duis&vitae=ac&ipsum=nibh&aliquam=fusce&non=lacus&mauris=purus&morbi=aliquet&non=at&lectus=feugiat&aliquam=non&sit=pretium&amet=quis&diam=lectus&in=suspendisse&magna=potenti&bibendum=in&imperdiet=eleifend&nullam=quam&orci=a&pede=odio&venenatis=in&non=hac&sodales=habitasse&sed=platea&tincidunt=dictumst&eu=maecenas", + "scale": 14 + }, + { + "type": "Bosco-Greenfelder", + "rating": 45, + "link": "https://bloglovin.com/purus/aliquet/at/feugiat.jsp?ultrices=lectus&aliquet=in&maecenas=est&leo=risus&odio=auctor&condimentum=sed&id=tristique&luctus=in&nec=tempus&molestie=sit&sed=amet&justo=sem&pellentesque=fusce&viverra=consequat&pede=nulla&ac=nisl&diam=nunc&cras=nisl&pellentesque=duis&volutpat=bibendum&dui=felis&maecenas=sed&tristique=interdum&est=venenatis&et=turpis&tempus=enim&semper=blandit&est=mi&quam=in&pharetra=porttitor&magna=pede&ac=justo&consequat=eu&metus=massa&sapien=donec&ut=dapibus&nunc=duis&vestibulum=at&ante=velit&ipsum=eu&primis=est&in=congue&faucibus=elementum&orci=in&luctus=hac&et=habitasse&ultrices=platea&posuere=dictumst&cubilia=morbi&curae=vestibulum&mauris=velit&viverra=id&diam=pretium&vitae=iaculis&quam=diam&suspendisse=erat&potenti=fermentum&nullam=justo&porttitor=nec&lacus=condimentum&at=neque&turpis=sapien&donec=placerat&posuere=ante&metus=nulla&vitae=justo&ipsum=aliquam&aliquam=quis&non=turpis&mauris=eget&morbi=elit&non=sodales&lectus=scelerisque&aliquam=mauris&sit=sit&amet=amet&diam=eros&in=suspendisse&magna=accumsan&bibendum=tortor", + "scale": 15 + }, + { + "type": "Maggio-Gaylord", + "rating": 21, + "link": "https://paginegialle.it/lorem/id/ligula/suspendisse.xml?sit=duis&amet=aliquam&eros=convallis&suspendisse=nunc&accumsan=proin&tortor=at&quis=turpis&turpis=a&sed=pede&ante=posuere&vivamus=nonummy&tortor=integer&duis=non&mattis=velit&egestas=donec&metus=diam&aenean=neque&fermentum=vestibulum&donec=eget&ut=vulputate&mauris=ut&eget=ultrices&massa=vel&tempor=augue&convallis=vestibulum", + "scale": 16 + }, + { + "type": "Stroman-DuBuque", + "rating": 91, + "link": "https://yellowbook.com/suspendisse/accumsan.jsp?aliquam=dui&quis=luctus&turpis=rutrum&eget=nulla&elit=tellus&sodales=in&scelerisque=sagittis&mauris=dui&sit=vel&amet=nisl&eros=duis&suspendisse=ac", + "scale": 17 + }, + { + "type": "Denesik LLC", + "rating": 93, + "link": "http://addtoany.com/non/pretium/quis.jpg?in=quam&consequat=turpis&ut=adipiscing&nulla=lorem&sed=vitae&accumsan=mattis&felis=nibh&ut=ligula&at=nec&dolor=sem&quis=duis&odio=aliquam&consequat=convallis&varius=nunc&integer=proin&ac=at&leo=turpis&pellentesque=a&ultrices=pede&mattis=posuere&odio=nonummy&donec=integer&vitae=non&nisi=velit&nam=donec&ultrices=diam&libero=neque&non=vestibulum&mattis=eget&pulvinar=vulputate&nulla=ut&pede=ultrices&ullamcorper=vel&augue=augue&a=vestibulum&suscipit=ante&nulla=ipsum&elit=primis&ac=in&nulla=faucibus&sed=orci&vel=luctus&enim=et&sit=ultrices&amet=posuere&nunc=cubilia&viverra=curae", + "scale": 18 + }, + { + "type": "Homenick, Frami and Walsh", + "rating": 23, + "link": "http://ed.gov/congue/eget/semper/rutrum.json?ut=pulvinar&odio=sed&cras=nisl&mi=nunc&pede=rhoncus&malesuada=dui&in=vel", + "scale": 19 + }, + { + "type": "Schmidt, Ritchie and Kreiger", + "rating": 54, + "link": "https://usnews.com/ipsum/primis/in/faucibus/orci.xml?donec=consectetuer&quis=adipiscing&orci=elit&eget=proin&orci=interdum&vehicula=mauris&condimentum=non&curabitur=ligula&in=pellentesque&libero=ultrices&ut=phasellus&massa=id&volutpat=sapien&convallis=in&morbi=sapien&odio=iaculis&odio=congue&elementum=vivamus&eu=metus&interdum=arcu&eu=adipiscing&tincidunt=molestie&in=hendrerit&leo=at&maecenas=vulputate&pulvinar=vitae&lobortis=nisl&est=aenean&phasellus=lectus&sit=pellentesque&amet=eget&erat=nunc&nulla=donec&tempus=quis&vivamus=orci&in=eget&felis=orci&eu=vehicula&sapien=condimentum&cursus=curabitur&vestibulum=in&proin=libero&eu=ut&mi=massa&nulla=volutpat&ac=convallis&enim=morbi&in=odio&tempor=odio&turpis=elementum&nec=eu&euismod=interdum&scelerisque=eu&quam=tincidunt&turpis=in&adipiscing=leo&lorem=maecenas&vitae=pulvinar&mattis=lobortis&nibh=est&ligula=phasellus&nec=sit&sem=amet&duis=erat", + "scale": 20 + }, + { + "type": "Schneider, Welch and Wolff", + "rating": 5, + "link": "http://epa.gov/elementum/eu/interdum/eu/tincidunt/in/leo.html?ante=potenti&vivamus=nullam&tortor=porttitor&duis=lacus&mattis=at&egestas=turpis&metus=donec&aenean=posuere&fermentum=metus&donec=vitae&ut=ipsum&mauris=aliquam&eget=non&massa=mauris&tempor=morbi&convallis=non&nulla=lectus&neque=aliquam&libero=sit&convallis=amet&eget=diam&eleifend=in&luctus=magna&ultricies=bibendum&eu=imperdiet&nibh=nullam&quisque=orci&id=pede&justo=venenatis&sit=non&amet=sodales&sapien=sed&dignissim=tincidunt&vestibulum=eu&vestibulum=felis&ante=fusce&ipsum=posuere&primis=felis&in=sed&faucibus=lacus&orci=morbi&luctus=sem&et=mauris&ultrices=laoreet&posuere=ut&cubilia=rhoncus&curae=aliquet&nulla=pulvinar&dapibus=sed&dolor=nisl&vel=nunc&est=rhoncus&donec=dui&odio=vel&justo=sem&sollicitudin=sed&ut=sagittis&suscipit=nam&a=congue&feugiat=risus&et=semper&eros=porta&vestibulum=volutpat&ac=quam&est=pede&lacinia=lobortis&nisi=ligula&venenatis=sit&tristique=amet&fusce=eleifend&congue=pede&diam=libero&id=quis&ornare=orci&imperdiet=nullam&sapien=molestie&urna=nibh&pretium=in&nisl=lectus&ut=pellentesque&volutpat=at&sapien=nulla&arcu=suspendisse&sed=potenti&augue=cras&aliquam=in&erat=purus&volutpat=eu&in=magna&congue=vulputate&etiam=luctus&justo=cum&etiam=sociis&pretium=natoque&iaculis=penatibus&justo=et&in=magnis&hac=dis", + "scale": 21 + }, + { + "type": "Gislason LLC", + "rating": 57, + "link": "https://skype.com/pretium.json?maecenas=tincidunt&leo=eget&odio=tempus&condimentum=vel&id=pede&luctus=morbi&nec=porttitor&molestie=lorem&sed=id&justo=ligula&pellentesque=suspendisse&viverra=ornare&pede=consequat&ac=lectus&diam=in&cras=est&pellentesque=risus&volutpat=auctor&dui=sed&maecenas=tristique&tristique=in&est=tempus&et=sit&tempus=amet&semper=sem&est=fusce&quam=consequat&pharetra=nulla&magna=nisl&ac=nunc&consequat=nisl&metus=duis&sapien=bibendum&ut=felis&nunc=sed&vestibulum=interdum&ante=venenatis&ipsum=turpis&primis=enim&in=blandit&faucibus=mi&orci=in&luctus=porttitor&et=pede&ultrices=justo&posuere=eu&cubilia=massa&curae=donec&mauris=dapibus&viverra=duis&diam=at&vitae=velit&quam=eu&suspendisse=est&potenti=congue&nullam=elementum&porttitor=in&lacus=hac&at=habitasse&turpis=platea&donec=dictumst&posuere=morbi&metus=vestibulum&vitae=velit&ipsum=id&aliquam=pretium&non=iaculis&mauris=diam&morbi=erat&non=fermentum&lectus=justo&aliquam=nec&sit=condimentum&amet=neque&diam=sapien&in=placerat&magna=ante&bibendum=nulla&imperdiet=justo&nullam=aliquam&orci=quis&pede=turpis&venenatis=eget&non=elit&sodales=sodales&sed=scelerisque", + "scale": 22 + }, + { + "type": "Friesen Inc", + "rating": 32, + "link": "https://ustream.tv/ac/lobortis/vel.xml?odio=in&in=imperdiet&hac=et&habitasse=commodo&platea=vulputate&dictumst=justo&maecenas=in&ut=blandit&massa=ultrices&quis=enim&augue=lorem&luctus=ipsum&tincidunt=dolor&nulla=sit&mollis=amet&molestie=consectetuer&lorem=adipiscing&quisque=elit&ut=proin&erat=interdum&curabitur=mauris&gravida=non&nisi=ligula&at=pellentesque&nibh=ultrices&in=phasellus&hac=id&habitasse=sapien&platea=in&dictumst=sapien&aliquam=iaculis&augue=congue&quam=vivamus&sollicitudin=metus&vitae=arcu&consectetuer=adipiscing&eget=molestie&rutrum=hendrerit&at=at&lorem=vulputate&integer=vitae&tincidunt=nisl&ante=aenean&vel=lectus&ipsum=pellentesque&praesent=eget&blandit=nunc&lacinia=donec&erat=quis&vestibulum=orci&sed=eget&magna=orci&at=vehicula", + "scale": 23 + }, + { + "type": "Haley-Bashirian", + "rating": 17, + "link": "https://xing.com/et.jsp?ultrices=nunc&erat=donec&tortor=quis&sollicitudin=orci&mi=eget&sit=orci&amet=vehicula&lobortis=condimentum&sapien=curabitur&sapien=in&non=libero&mi=ut&integer=massa&ac=volutpat&neque=convallis&duis=morbi&bibendum=odio&morbi=odio&non=elementum&quam=eu&nec=interdum&dui=eu&luctus=tincidunt&rutrum=in&nulla=leo&tellus=maecenas&in=pulvinar&sagittis=lobortis&dui=est&vel=phasellus&nisl=sit&duis=amet&ac=erat&nibh=nulla&fusce=tempus&lacus=vivamus&purus=in&aliquet=felis&at=eu&feugiat=sapien&non=cursus&pretium=vestibulum&quis=proin&lectus=eu&suspendisse=mi&potenti=nulla&in=ac&eleifend=enim&quam=in&a=tempor&odio=turpis", + "scale": 24 + }, + { + "type": "Harris-Gleason", + "rating": 28, + "link": "https://umn.edu/dis/parturient/montes/nascetur.png?augue=vestibulum&a=rutrum&suscipit=rutrum&nulla=neque&elit=aenean&ac=auctor&nulla=gravida&sed=sem&vel=praesent&enim=id&sit=massa&amet=id&nunc=nisl&viverra=venenatis&dapibus=lacinia&nulla=aenean&suscipit=sit&ligula=amet&in=justo&lacus=morbi", + "scale": 25 + }, + { + "type": "Kohler and Sons", + "rating": 38, + "link": "https://mozilla.org/ultrices.xml?pellentesque=lacus&eget=purus&nunc=aliquet&donec=at&quis=feugiat&orci=non&eget=pretium&orci=quis&vehicula=lectus&condimentum=suspendisse&curabitur=potenti&in=in&libero=eleifend&ut=quam&massa=a&volutpat=odio&convallis=in&morbi=hac&odio=habitasse&odio=platea&elementum=dictumst&eu=maecenas&interdum=ut&eu=massa&tincidunt=quis&in=augue&leo=luctus&maecenas=tincidunt&pulvinar=nulla&lobortis=mollis&est=molestie&phasellus=lorem&sit=quisque&amet=ut&erat=erat&nulla=curabitur&tempus=gravida", + "scale": 26 + }, + { + "type": "Huels, Fritsch and Ullrich", + "rating": 77, + "link": "https://wunderground.com/integer/a/nibh/in/quis/justo/maecenas.png?volutpat=metus&in=sapien&congue=ut&etiam=nunc&justo=vestibulum&etiam=ante&pretium=ipsum&iaculis=primis&justo=in&in=faucibus&hac=orci&habitasse=luctus&platea=et&dictumst=ultrices&etiam=posuere", + "scale": 27 + }, + { + "type": "Kris Inc", + "rating": 69, + "link": "https://army.mil/vestibulum/ante/ipsum.png?a=amet&libero=turpis&nam=elementum&dui=ligula&proin=vehicula&leo=consequat&odio=morbi&porttitor=a&id=ipsum&consequat=integer&in=a&consequat=nibh&ut=in&nulla=quis&sed=justo&accumsan=maecenas&felis=rhoncus&ut=aliquam&at=lacus&dolor=morbi&quis=quis&odio=tortor&consequat=id&varius=nulla&integer=ultrices&ac=aliquet&leo=maecenas&pellentesque=leo&ultrices=odio&mattis=condimentum&odio=id&donec=luctus&vitae=nec&nisi=molestie&nam=sed&ultrices=justo&libero=pellentesque&non=viverra&mattis=pede&pulvinar=ac&nulla=diam&pede=cras&ullamcorper=pellentesque&augue=volutpat&a=dui&suscipit=maecenas&nulla=tristique&elit=est&ac=et&nulla=tempus&sed=semper&vel=est&enim=quam&sit=pharetra&amet=magna&nunc=ac&viverra=consequat&dapibus=metus", + "scale": 28 + }, + { + "type": "Torphy, Macejkovic and Kuvalis", + "rating": 61, + "link": "https://ihg.com/commodo/vulputate/justo/in.jsp?pharetra=vestibulum&magna=ante&ac=ipsum&consequat=primis&metus=in&sapien=faucibus&ut=orci&nunc=luctus&vestibulum=et&ante=ultrices&ipsum=posuere&primis=cubilia&in=curae&faucibus=mauris&orci=viverra&luctus=diam&et=vitae&ultrices=quam&posuere=suspendisse&cubilia=potenti&curae=nullam&mauris=porttitor&viverra=lacus&diam=at&vitae=turpis&quam=donec&suspendisse=posuere&potenti=metus&nullam=vitae&porttitor=ipsum&lacus=aliquam&at=non&turpis=mauris&donec=morbi&posuere=non&metus=lectus&vitae=aliquam&ipsum=sit&aliquam=amet&non=diam&mauris=in&morbi=magna&non=bibendum&lectus=imperdiet&aliquam=nullam&sit=orci&amet=pede&diam=venenatis&in=non", + "scale": 29 + }, + { + "type": "Zemlak LLC", + "rating": 1, + "link": "http://networkadvertising.org/donec/diam.html?justo=lorem&sollicitudin=ipsum&ut=dolor&suscipit=sit&a=amet&feugiat=consectetuer&et=adipiscing&eros=elit&vestibulum=proin&ac=risus&est=praesent&lacinia=lectus&nisi=vestibulum&venenatis=quam&tristique=sapien&fusce=varius&congue=ut&diam=blandit&id=non&ornare=interdum&imperdiet=in&sapien=ante&urna=vestibulum&pretium=ante&nisl=ipsum&ut=primis&volutpat=in&sapien=faucibus&arcu=orci&sed=luctus&augue=et&aliquam=ultrices&erat=posuere&volutpat=cubilia&in=curae&congue=duis&etiam=faucibus&justo=accumsan&etiam=odio&pretium=curabitur&iaculis=convallis&justo=duis&in=consequat&hac=dui&habitasse=nec&platea=nisi&dictumst=volutpat&etiam=eleifend&faucibus=donec&cursus=ut&urna=dolor&ut=morbi&tellus=vel&nulla=lectus&ut=in&erat=quam&id=fringilla&mauris=rhoncus&vulputate=mauris&elementum=enim&nullam=leo&varius=rhoncus&nulla=sed&facilisi=vestibulum&cras=sit&non=amet&velit=cursus&nec=id&nisi=turpis&vulputate=integer&nonummy=aliquet&maecenas=massa&tincidunt=id&lacus=lobortis&at=convallis", + "scale": 30 + } +] diff --git a/src/mocks/qualifications.json b/src/mocks/qualifications.json new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/src/mocks/qualifications.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/src/navigation/AppNavigator.js b/src/navigation/AppNavigator.js index 856b3712..bc31da44 100644 --- a/src/navigation/AppNavigator.js +++ b/src/navigation/AppNavigator.js @@ -1,13 +1,13 @@ -import React, {Suspense} from 'react'; -import {useSelector} from 'react-redux'; -import {BrowserRouter as Router, Route} from 'react-router-dom'; -import {IndeterminateProgressOverlay} from '../components/'; +import React, { Suspense } from 'react'; +import { useSelector } from 'react-redux'; +import { BrowserRouter as Router, Route } from 'react-router-dom'; +import { IndeterminateProgressOverlay } from '../components/'; import * as Pages from '../pages'; -import {AppContainer, AppHeader} from '../components'; +import { AppContainer, AppHeader } from '../components'; const AppNavigator = () => { - const {showProgressOverlay} = useSelector(store => store.app); + const { showProgressOverlay } = useSelector(store => store.app); return ( @@ -23,4 +23,4 @@ const AppNavigator = () => { ); }; -export {AppNavigator}; +export { AppNavigator }; diff --git a/src/start-react.js b/src/start-react.js index 0047ea71..3f4209f5 100644 --- a/src/start-react.js +++ b/src/start-react.js @@ -1,7 +1,7 @@ const net = require('net'); const childProcess = require('child_process'); -const port = process.env.PORT ? process.env.PORT - 100 : 3000; +const port = process.env.PORT ? process.env.PORT - 100 : 3001; process.env.ELECTRON_START_URL = `http://localhost:${port}`; diff --git a/src/store/actions/climateWarehouseActions.js b/src/store/actions/climateWarehouseActions.js new file mode 100644 index 00000000..9db6b336 --- /dev/null +++ b/src/store/actions/climateWarehouseActions.js @@ -0,0 +1,138 @@ +import _ from 'lodash'; +import { keyMirror } from '../store-functions'; +import constants from '../../constants'; + +import { coBenefitResponseStub, projectRatingResponseStub, qualificationsResponseStub } from '../../mocks'; + +import { + activateProgressIndicator, + deactivateProgressIndicator, + setGlobalErrorMessage, +} from './app'; + +export const actions = keyMirror('GET_RATINGS', 'GET_COBENEFITS', 'QUALIFICATIONS'); + +export const mockedRatingsResponse = { + type: actions.GET_RATINGS, + // Different envs import this differently + payload: _.get( + projectRatingResponseStub, + 'default', + projectRatingResponseStub, + ), +}; + +export const getRatings = ({ + useMockedResponse = false, + useApiMock = false, +}) => { + return async dispatch => { + dispatch(activateProgressIndicator); + + try { + if (useMockedResponse) { + dispatch(mockedRatingsResponse); + } else { + let url = `${constants.API_HOST}/ratings`; + if (useApiMock) url = `${url}?useMock=true`; + const response = fetch(url); + + if (response.ok) { + const results = await response.json(); + dispatch({ + type: actions.GET_RATINGS, + payload: results, + }); + } + } + } catch { + dispatch(setGlobalErrorMessage('Something went wrong...')); + } finally { + dispatch(deactivateProgressIndicator); + } + }; +}; + +const mockedCoBenefitResponse = { + type: actions.GET_COBENEFITS, + // Different envs import this differently + payload: _.get(coBenefitResponseStub, 'default', coBenefitResponseStub), +}; + +export const getCoBenefits = ({ + useMockedResponse = false, + useApiMock = false, +}) => { + return async dispatch => { + try { + dispatch(activateProgressIndicator); + + if (useMockedResponse) { + dispatch(mockedCoBenefitResponse); + } else { + let url = `${constants.API_HOST}/co-benefits`; + if (useApiMock) { + url = `${url}?useMock=true`; + } + + const response = fetch(url); + + if (response.ok) { + const results = await response.json(); + dispatch({ + type: actions.GET_COBENEFITS, + payload: results, + }); + } + } + } catch { + dispatch(setGlobalErrorMessage('Something went wrong...')); + } finally { + dispatch(deactivateProgressIndicator); + } + }; +}; + +export const mockQualificationsResponse = { + type: actions.QUALIFICATIONS, + // Different envs import this differently + payload: _.get( + qualificationsResponseStub, + 'default', + qualificationsResponseStub, + ), +}; + +export const getQualifications = ({ + useMockedResponse = false, + useApiMock = false, +}) => { + return async dispatch => { + try { + dispatch(activateProgressIndicator); + + if (useMockedResponse) { + dispatch(mockQualificationsResponse); + } else { + let url = `${constants.API_HOST}/qualifications`; + if (useApiMock) { + url = `${url}?useMock=true`; + } + + const response = fetch(url); + + if (response.ok) { + const results = await response.json(); + dispatch({ + type: actions.QUALIFICATIONS, + payload: results, + }); + } + } + } catch { + dispatch(setGlobalErrorMessage('Something went wrong...')); + } finally { + dispatch(deactivateProgressIndicator); + } + }; +}; diff --git a/src/store/actions/tokens.js b/src/store/actions/tokens.js deleted file mode 100644 index e1a39ba1..00000000 --- a/src/store/actions/tokens.js +++ /dev/null @@ -1,49 +0,0 @@ -import _ from 'lodash'; -import {keyMirror} from '../store-functions'; -import constants from '../../constants'; - -import { - activateProgressIndicator, - deactivateProgressIndicator, - setGlobalErrorMessage, -} from './app'; - -import {mockedRetiredTokenResponse} from '../../mocks'; - -export const actions = keyMirror('GET_RETIRED_TOKENS'); - -const mockedTokenResponse = { - type: actions.GET_RETIRED_TOKENS, - // Different envs import this differently - payload: _.get( - mockedRetiredTokenResponse, - 'default', - mockedRetiredTokenResponse, - ), -}; - -export const getRetiredTokens = ({useMockedResponse = false}) => { - return async dispatch => { - try { - dispatch(activateProgressIndicator); - - if (useMockedResponse) { - dispatch(mockedTokenResponse); - } else { - const response = fetch(`${constants.API_HOST}/tokens`); - - if (response.ok) { - const results = await response.json(); - dispatch({ - type: actions.GET_RETIRED_TOKENS, - payload: results, - }); - } - } - } catch { - dispatch(setGlobalErrorMessage('Something went wrong...')); - } finally { - dispatch(deactivateProgressIndicator); - } - }; -}; diff --git a/src/store/index.js b/src/store/index.js index f5bd8b15..6cceabdf 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,11 +1,11 @@ -import {createStore, combineReducers, applyMiddleware} from 'redux'; +import { createStore, combineReducers, applyMiddleware } from 'redux'; import ReduxThunk from 'redux-thunk'; -import {appReducer, tokenReducer} from './reducers'; +import { appReducer, climateWarehouseReducer } from './reducers'; const rootReducer = combineReducers({ app: appReducer, - tokens: tokenReducer, + climateWarehouse: climateWarehouseReducer, }); export default createStore(rootReducer, applyMiddleware(ReduxThunk)); diff --git a/src/store/reducers/appReducer.js b/src/store/reducers/appReducer.js index 16bfebf8..7bdb9bcd 100644 --- a/src/store/reducers/appReducer.js +++ b/src/store/reducers/appReducer.js @@ -1,12 +1,12 @@ import u from 'updeep'; -import {actions as appActions} from '../actions/app'; +import { actions as appActions } from '../actions/app'; import constants from '../../constants'; const initialState = { placeholderValue: 'THIS STRING WAS LOADED FROM THE STORE!', showProgressOverlay: false, - theme: constants.THEME.DARK, + theme: constants.THEME.LIGHT, errorMessage: null, locale: null, }; @@ -14,26 +14,26 @@ const initialState = { const appReducer = (state = initialState, action) => { switch (action.type) { case appActions.ACTIVATE_PROGRESS_INDICATOR: - return u({showProgressOverlay: true}, state); + return u({ showProgressOverlay: true }, state); case appActions.DEACTIVATE_PROGRESS_INDICATOR: - return u({showProgressOverlay: false}, state); + return u({ showProgressOverlay: false }, state); case appActions.SET_GLOBAL_ERROR_MESSAGE: - return u({errorMessage: action.payload}, state); + return u({ errorMessage: action.payload }, state); case appActions.CLEAR_GLOBAL_ERROR_MESSAGE: - return u({errorMessage: null}, state); + return u({ errorMessage: null }, state); case appActions.SET_LOCALE: - return u({locale: action.payload}, state); + return u({ locale: action.payload }, state); case appActions.SET_THEME: if ( action.payload === constants.THEME.LIGHT || action.payload === constants.THEME.DARK ) { - return u({theme: action.payload}, state); + return u({ theme: action.payload }, state); } return state; @@ -44,10 +44,10 @@ const appReducer = (state = initialState, action) => { ? constants.THEME.LIGHT : constants.THEME.DARK; localStorage.setItem('theme', theme); - return u({theme}, state); + return u({ theme }, state); default: return state; } }; -export {appReducer}; +export { appReducer }; diff --git a/src/store/reducers/climateWarehouseReducer.js b/src/store/reducers/climateWarehouseReducer.js new file mode 100644 index 00000000..d641af3d --- /dev/null +++ b/src/store/reducers/climateWarehouseReducer.js @@ -0,0 +1,27 @@ +import u from 'updeep'; + +import { actions as climateWarehouseActions } from '../actions/climateWarehouseActions'; + +const initialState = { + ratings: null, + coBenefits: null, + qualifications: null +}; + +const climateWarehouseReducer = (state = initialState, action) => { + switch (action.type) { + case climateWarehouseActions.GET_RATINGS: + return u({ ratings: action.payload }, state); + + case climateWarehouseActions.GET_COBENEFITS: + return u({ coBenefits: action.payload }, state); + + case climateWarehouseActions.QUALIFICATIONS: + return u({ qualifications: action.payload }, state); + + default: + return state; + } +}; + +export { climateWarehouseReducer }; diff --git a/src/store/reducers/index.js b/src/store/reducers/index.js index db9bd7ed..cef1898c 100644 --- a/src/store/reducers/index.js +++ b/src/store/reducers/index.js @@ -1,2 +1,3 @@ export * from './appReducer'; -export * from './tokenReducer'; +export * from './climateWarehouseReducer'; +export * from './' \ No newline at end of file diff --git a/src/store/reducers/tokenReducer.js b/src/store/reducers/tokenReducer.js deleted file mode 100644 index b496e9a4..00000000 --- a/src/store/reducers/tokenReducer.js +++ /dev/null @@ -1,18 +0,0 @@ -import u from 'updeep'; - -import {actions as tokenActions} from '../actions/tokens'; - -const initialState = { - retiredTokens: null, -}; - -const tokenReducer = (state = initialState, action) => { - switch (action.type) { - case tokenActions.GET_RETIRED_TOKENS: - return u({retiredTokens: action.payload}, state); - default: - return state; - } -}; - -export {tokenReducer};