diff --git a/NDAO_API/NDAO_API/Startup.cs b/NDAO_API/NDAO_API/Startup.cs index d1d0ed9..018b3b0 100644 --- a/NDAO_API/NDAO_API/Startup.cs +++ b/NDAO_API/NDAO_API/Startup.cs @@ -39,14 +39,10 @@ public void ConfigureServices(IServiceCollection services) options.AddPolicy("CORSPolicy", builder => { - builder.WithOrigins( - "http://localhost:8085", //NCCRD LOCAL - "http://localhost:8091", //CCIS LOCAL - "http://app01.saeon.ac.za/ccis", //CCIS LIVE - "http://app01.saeon.ac.za/nccrdsite" //NCCRD LIVE - ) - .AllowAnyHeader() - .AllowAnyMethod(); + builder + .AllowAnyOrigin() + .AllowAnyHeader() + .AllowAnyMethod(); }); }); diff --git a/NDAO_Client_React/.babelrc b/NDAO_Client_React/.babelrc index 1a63eab..ceae405 100644 --- a/NDAO_Client_React/.babelrc +++ b/NDAO_Client_React/.babelrc @@ -3,7 +3,11 @@ [ "@babel/preset-env", { - "modules": false + "modules": false, + "useBuiltIns": "entry", + "targets": { + "ie": "11" + } } ], "@babel/preset-react" diff --git a/NDAO_Client_React/app/css/antd.tree-select.css b/NDAO_Client_React/app/css/antd.tree-select.css new file mode 100644 index 0000000..d42cf1b --- /dev/null +++ b/NDAO_Client_React/app/css/antd.tree-select.css @@ -0,0 +1,37 @@ +.ant-select-tree li .ant-select-tree-node-content-wrapper { + display: inline-block; + width: calc(100% - 22px); /*changed: calc(100% - 24px)*/ + margin: 0; + padding: 3px 5px; + color: rgba(0, 0, 0, 0.65); + text-decoration: none; + border-radius: 2px; + cursor: pointer; + -webkit-transition: all 0.3s; + transition: all 0.3s; +} + +.ant-select-tree li span.ant-select-tree-switcher { + position: relative; + margin-top: -5px; /*added*/ + margin-left: -1px; /*added*/ + margin-right: 2px; /*added*/ +} + +:root .ant-select-tree li span.ant-select-tree-switcher.ant-select-tree-switcher_open .ant-select-switcher-icon { + font-size: 22px; /*changed: 12px*/ + color: white; /*added*/ + background-color: #8EAC85; /*added*/ + border: 1px solid dimgray; /*added*/ + border-radius: 2px; /*added*/ + width: 26px; /*added*/ +} + +:root .ant-select-tree li span.ant-select-tree-switcher.ant-select-tree-switcher_close .ant-select-switcher-icon { + font-size: 24px; /*changed: 12px*/ + color: dimgray; /*added*/ + background-color: #8EAC85; /*added*/ + border: 1px solid dimgray; /*added*/ + border-radius: 2px; /*added*/ + width: 26px; /*added*/ +} \ No newline at end of file diff --git a/NDAO_Client_React/app/data/footerConfig.js b/NDAO_Client_React/app/data/footerConfig.js index 5e20bc0..0e9cef8 100644 --- a/NDAO_Client_React/app/data/footerConfig.js +++ b/NDAO_Client_React/app/data/footerConfig.js @@ -5,7 +5,7 @@ export const footerContent = { { text: "Technology", links: [ - { text: "DEA NCCIS uses open source, government funded facilities provided by SAEON. The DST and NRF funds the SAEON Open Data Platform (ODP) and associated portals. Developed by SAEON on behalf of DST, DEA, DRDLR, and other stakeholders." }, + { text: "DEA NDAO uses open source, government funded facilities provided by SAEON. The DST and NRF funds the SAEON Open Data Platform (ODP) and associated portals. Developed by SAEON on behalf of DST, DEA, DRDLR, and other stakeholders." }, ] }, { diff --git a/NDAO_Client_React/app/index.ejs b/NDAO_Client_React/app/index.ejs index b6fb53c..4b7f956 100644 --- a/NDAO_Client_React/app/index.ejs +++ b/NDAO_Client_React/app/index.ejs @@ -4,7 +4,7 @@ - NCCIS - National Climate Change Information System + NDAO - National Desired Adaptation Outcomes diff --git a/NDAO_Client_React/app/js/components/input/FileUpload.jsx b/NDAO_Client_React/app/js/components/input/FileUpload.jsx index 905dc69..717a5d5 100644 --- a/NDAO_Client_React/app/js/components/input/FileUpload.jsx +++ b/NDAO_Client_React/app/js/components/input/FileUpload.jsx @@ -68,7 +68,7 @@ class FileUpload extends React.Component { //Remove try { - let res = await fetch(apiBaseURL + "RemoveFile", { + let res = await globalFunctions.CustomFetch(apiBaseURL + "RemoveFile", { method: "POST", headers: { "Content-Type": "application/json", @@ -114,7 +114,7 @@ class FileUpload extends React.Component { //Upload try { - let res = await fetch(apiBaseURL + "UploadFile", { + let res = await globalFunctions.CustomFetch(apiBaseURL + "UploadFile", { method: "POST", headers: { "Content-Type": "application/json", diff --git a/NDAO_Client_React/app/js/components/input/TreeSelectInput.jsx b/NDAO_Client_React/app/js/components/input/TreeSelectInput.jsx index bc6edf3..3c317f7 100644 --- a/NDAO_Client_React/app/js/components/input/TreeSelectInput.jsx +++ b/NDAO_Client_React/app/js/components/input/TreeSelectInput.jsx @@ -4,6 +4,7 @@ import React from 'react' import { Tooltip } from 'mdbreact' import * as globalFunctions from '../../globalFunctions' import { TreeSelect } from 'antd' +import '../../../css/antd.tree-select.css' //AntD Tree-Select // import TreeSelect from 'antd/lib/tree-select' diff --git a/NDAO_Client_React/app/js/components/layout/HostedContentFrame.jsx b/NDAO_Client_React/app/js/components/layout/HostedContentFrame.jsx index ac0da59..cb9938a 100644 --- a/NDAO_Client_React/app/js/components/layout/HostedContentFrame.jsx +++ b/NDAO_Client_React/app/js/components/layout/HostedContentFrame.jsx @@ -2,10 +2,11 @@ import React from 'react' import * as globalFunctions from '../../globalFunctions' -import { Col, Row, Container, Footer as MDBFooter, Modal, ModalBody, ModalHeader, ModalFooter, MDBBtn } from 'mdbreact' +import { Modal, ModalBody, ModalHeader, ModalFooter } from 'mdbreact' import loader from '../../../images/Other/loader.gif' import { Button } from 'antd'; -import { object } from 'prop-types'; +import { DEAGreen } from '../../config/colours'; + // Properties: // - source : Component label // - width : Width; Default - 100% @@ -39,12 +40,12 @@ class HostedContentFrame extends React.Component { source = globalFunctions.fixEmptyValue(source, "http://www.example.com") width = globalFunctions.fixEmptyValue(width, "100%") - height = globalFunctions.fixEmptyValue(height, "550px") + height = globalFunctions.fixEmptyValue(height, "73vh") showSource = globalFunctions.fixEmptyValue(showSource, false) return (
- + {title} @@ -66,6 +67,11 @@ class HostedContentFrame extends React.Component {  source: {source} + + +
) diff --git a/NDAO_Client_React/app/js/components/navigation/Header.jsx b/NDAO_Client_React/app/js/components/navigation/Header.jsx index b8beb61..4723010 100644 --- a/NDAO_Client_React/app/js/components/navigation/Header.jsx +++ b/NDAO_Client_React/app/js/components/navigation/Header.jsx @@ -32,7 +32,7 @@ class Header extends React.Component {

- NCCIS + NDAO {/* BETA tag */} @@ -42,7 +42,7 @@ class Header extends React.Component {

- National Climate Change Information System + National Desired Adaptation Outcomes
diff --git a/NDAO_Client_React/app/js/components/navigation/Navbar.jsx b/NDAO_Client_React/app/js/components/navigation/Navbar.jsx index 123e82a..cf354cb 100644 --- a/NDAO_Client_React/app/js/components/navigation/Navbar.jsx +++ b/NDAO_Client_React/app/js/components/navigation/Navbar.jsx @@ -13,8 +13,6 @@ import NWIS from '../pages/Tools/NWIS.jsx'; import SARVA from '../pages/Tools/SARVA.jsx'; import { data as NavData } from '../../../data/sideNavData' -const _gf = require('../../globalFunctions') - const mapStateToProps = (state, props) => { let user = state.oidc.user let { general: { showSideNav } } = state @@ -143,17 +141,17 @@ class Navbar extends React.Component { {/* Tools */} - + {/* Tools { window.open("https://south-africa-platform.vizzuality.com/ ", "_blank") }}> Biennial Update Report (BUR) - { window.open("https://www.dwa.gov.za/Hydrology/Weekly/Province.aspx", "_blank") /*this.setState({ showDASL: true })*/ }}> + { window.open("https://www.dwa.gov.za/Hydrology/Weekly/Province.aspx", "_blank") }}> Dam And Stream Levels - { window.open("http://www.letsrespondtoolkit.org/", "_blank") /*this.setState({ showLRT: true })*/ }}> + { window.open("http://www.letsrespondtoolkit.org/", "_blank") }}> Lets Respond Toolkit { this.setState({ showNCCRD: true }) }}> @@ -162,7 +160,7 @@ class Navbar extends React.Component { { this.setState({ showNDMC: true }) }}> National Hazardous Events Database - { window.open("http://niwis.dws.gov.za/niwis2/", "_blank") /*this.setState({ showNWIS: true })*/ }}> + { window.open("http://niwis.dws.gov.za/niwis2/", "_blank") }}> National Water Information System { this.setState({ showSARVA: true }) }}> @@ -170,7 +168,7 @@ class Navbar extends React.Component { - + */} @@ -200,9 +198,9 @@ class Navbar extends React.Component { } {/* Contact */} - + {/* Contact - + */} {/* Login / Logout */} diff --git a/NDAO_Client_React/app/js/components/navigation/SideNav.css b/NDAO_Client_React/app/js/components/navigation/SideNav.css new file mode 100644 index 0000000..948cad2 --- /dev/null +++ b/NDAO_Client_React/app/js/components/navigation/SideNav.css @@ -0,0 +1,13 @@ +.nav-cat-head { + padding-top: 7px; + font-size: 15px; +} + +.nav-close-handle { + color: black; + box-shadow: none; + margin-right: 2px; + padding: 10px 3px 10px 2px; + border: 1px solid black; + border-radius: 3px; +} \ No newline at end of file diff --git a/NDAO_Client_React/app/js/components/navigation/SideNav.jsx b/NDAO_Client_React/app/js/components/navigation/SideNav.jsx index 5b0d5ac..770a975 100644 --- a/NDAO_Client_React/app/js/components/navigation/SideNav.jsx +++ b/NDAO_Client_React/app/js/components/navigation/SideNav.jsx @@ -2,13 +2,13 @@ import React from 'react' import { connect } from 'react-redux'; -import { - SideNav as MSBSideNav, Fa, SideNavItem, SideNavCat, SideNavNav, SideNavLink, Container, Row, Button, - Modal, ModalBody, ModalHeader, ModalFooter -} from 'mdbreact' +import { Fa, Row, Col, Button } from 'mdbreact' +import { Drawer, Collapse } from 'antd' +import { DEAGreen } from '../../config/colours.js' -import '../../../css/mdbreact-sidenav.css' -import loader from '../../../images/Other/loader.gif' +import './SideNav.css' + +const Panel = Collapse.Panel const mapStateToProps = (state, props) => { return {} @@ -49,7 +49,6 @@ class SideNav extends React.Component { } toggleNav(key) { - let { navOpen } = this.state if (navOpen.includes(key)) { @@ -63,49 +62,54 @@ class SideNav extends React.Component { } renderLinks(data, level = 0) { - - let { navOpen } = this.state let links = [] - //let indent = (level > 1 ? 26 * (level - 1) : 0) + "px" data.forEach(x => { if (typeof x.children !== 'undefined') { links.push( - + {x.text} + + } + style={{ + border: 0 + }} > {this.renderLinks(x.children, level + 1)} - + ) } else { if (typeof x.link !== 'undefined') { links.push( - { - this.showContent(x.link, x.text, x.window) - }} - > - - {x.text} - +
+ { + this.showContent(x.link, x.text, x.window) + }} + > + + {x.text} + +
) } else { links.push( - - - {x.text} - +
+ { + this.showContent(x.link, x.text, x.window) + }} + > + + {x.text} + +
) } } @@ -115,84 +119,122 @@ class SideNav extends React.Component { } closeModal() { - this.setState({ showContent: false }) - //this.props.toggleSideNav(false) + this.setState({ showContent: false, contentLink: "" }) } showContent(link, title, window) { - - if(window === 'blank'){ + if (window === 'blank') { var win = open(link, '_blank'); win.focus(); } - else{ + else { this.setState({ showContent: true, contentLink: link, contentTitle: title }) } - } render() { let { isOpen, data } = this.props - let { width, height, showContent, contentLink, contentTitle } = this.state + let { width, showContent, contentLink, contentTitle } = this.state - const sideNavWidth = 325 + const sideNavWidth = width < 325 ? "100%" : 325 return ( <> - - - - this.closeModal()} - style={{ width: (width - sideNavWidth - 20) + "px" }} - size="fluid" - fullHeight position="right" - > - this.closeModal()}> - {contentTitle} - - + placement="left" + width={width < 1250 ? "100vw" : "80vw"} + closable={true} + onClose={() => this.closeModal()} + visible={showContent} + bodyStyle={{ padding: 1, overflowX: 'hidden' }} + >