Skip to content

Commit

Permalink
Merge pull request #76 from SAEONData/dev
Browse files Browse the repository at this point in the history
Merge latest 'dev' into 'master'
  • Loading branch information
andre-engelbrecht authored Apr 11, 2019
2 parents 2025bcd + 84f6ffd commit d4ef230
Show file tree
Hide file tree
Showing 35 changed files with 453 additions and 455 deletions.
12 changes: 4 additions & 8 deletions NDAO_API/NDAO_API/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

Expand Down
6 changes: 5 additions & 1 deletion NDAO_Client_React/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
[
"@babel/preset-env",
{
"modules": false
"modules": false,
"useBuiltIns": "entry",
"targets": {
"ie": "11"
}
}
],
"@babel/preset-react"
Expand Down
37 changes: 37 additions & 0 deletions NDAO_Client_React/app/css/antd.tree-select.css
Original file line number Diff line number Diff line change
@@ -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*/
}
2 changes: 1 addition & 1 deletion NDAO_Client_React/app/data/footerConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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." },
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion NDAO_Client_React/app/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NCCIS - National Climate Change Information System</title>
<title>NDAO - National Desired Adaptation Outcomes</title>
<link rel="icon" href="#">
</head>

Expand Down
4 changes: 2 additions & 2 deletions NDAO_Client_React/app/js/components/input/FileUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
14 changes: 10 additions & 4 deletions NDAO_Client_React/app/js/components/layout/HostedContentFrame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down Expand Up @@ -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 (
<div>
<Modal isOpen={this.state.showModal} toggle={this.toggleModal} size="fluid" style={{ width: "95%" }} >
<Modal isOpen={this.state.showModal} toggle={this.toggleModal} size="fluid" fullHeight position="top" style={{ width: "95%" }} >
<ModalHeader toggle={this.toggleModal}>{title}

</ModalHeader>
Expand All @@ -66,6 +67,11 @@ class HostedContentFrame extends React.Component {
&nbsp;source: <a href={source} target="#"><u>{source}</u></a>
</span>
</ModalBody>
<ModalFooter>
<Button size="sm" color="" style={{ backgroundColor: DEAGreen }} onClick={this.toggleModal}>
Close
</Button>
</ModalFooter>
</Modal>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions NDAO_Client_React/app/js/components/navigation/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Header extends React.Component {
<Col md="6">
<div>
<h1 style={{ textAlign: "center", letterSpacing: "2px", color: "#2e7d32" }}>
<b>NCCIS</b>
<b>NDAO</b>

{/* BETA tag */}
<sub style={{ fontSize: "18px", backgroundColor: "#78e26c", borderRadius: "5px", padding: "2px" }}>
Expand All @@ -42,7 +42,7 @@ class Header extends React.Component {
</h1>
<p></p>
<h5 style={{ textAlign: "center", letterSpacing: "2px", marginTop: "-8px", color: "grey" }}>
<b>National Climate Change Information System</b>
<b>National Desired Adaptation Outcomes</b>
</h5>
</div>
</Col>
Expand Down
16 changes: 7 additions & 9 deletions NDAO_Client_React/app/js/components/navigation/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -143,17 +141,17 @@ class Navbar extends React.Component {
</NavItem>

{/* Tools */}
<NavItem>
{/* <NavItem>
<Dropdown>
<DropdownToggle nav caret style={{ color: "black" }}><b>Tools</b></DropdownToggle>
<DropdownMenu>
<DropdownItem onClick={() => { window.open("https://south-africa-platform.vizzuality.com/ ", "_blank") }}>
Biennial Update Report (BUR)
</DropdownItem>
<DropdownItem onClick={() => { window.open("https://www.dwa.gov.za/Hydrology/Weekly/Province.aspx", "_blank") /*this.setState({ showDASL: true })*/ }}>
<DropdownItem onClick={() => { window.open("https://www.dwa.gov.za/Hydrology/Weekly/Province.aspx", "_blank") }}>
Dam And Stream Levels
</DropdownItem>
<DropdownItem onClick={() => { window.open("http://www.letsrespondtoolkit.org/", "_blank") /*this.setState({ showLRT: true })*/ }}>
<DropdownItem onClick={() => { window.open("http://www.letsrespondtoolkit.org/", "_blank") }}>
Lets Respond Toolkit
</DropdownItem>
<DropdownItem onClick={() => { this.setState({ showNCCRD: true }) }}>
Expand All @@ -162,15 +160,15 @@ class Navbar extends React.Component {
<DropdownItem onClick={() => { this.setState({ showNDMC: true }) }}>
National Hazardous Events Database
</DropdownItem>
<DropdownItem onClick={() => { window.open("http://niwis.dws.gov.za/niwis2/", "_blank") /*this.setState({ showNWIS: true })*/ }}>
<DropdownItem onClick={() => { window.open("http://niwis.dws.gov.za/niwis2/", "_blank") }}>
National Water Information System
</DropdownItem>
<DropdownItem onClick={() => { this.setState({ showSARVA: true }) }}>
Risk And Vulnerability Hotspots
</DropdownItem>
</DropdownMenu>
</Dropdown>
</NavItem>
</NavItem> */}

</NavbarNav>

Expand Down Expand Up @@ -200,9 +198,9 @@ class Navbar extends React.Component {
}

{/* Contact */}
<NavItem style={{ marginLeft: "15px", marginRight: "15px", borderBottom: (locationHash === "#/contact" ? "4px solid dimgrey" : "0px solid white") }}>
{/* <NavItem style={{ marginLeft: "15px", marginRight: "15px", borderBottom: (locationHash === "#/contact" ? "4px solid dimgrey" : "0px solid white") }}>
<NavLink disabled to="contact" style={{ color: "grey" }}><b>Contact</b></NavLink>
</NavItem>
</NavItem> */}

{/* Login / Logout */}
<NavItem style={{ marginRight: "15px" }}>
Expand Down
13 changes: 13 additions & 0 deletions NDAO_Client_React/app/js/components/navigation/SideNav.css
Original file line number Diff line number Diff line change
@@ -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;
}
Loading

0 comments on commit d4ef230

Please # to comment.