Skip to content

Commit

Permalink
Fix: Url path, Navbar render
Browse files Browse the repository at this point in the history
Fix url path construction for API calls, NavBar render method lacking 'key' attribute for rendered children
  • Loading branch information
danesparza committed May 3, 2018
1 parent c4c1d8b commit c45833f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class NavBar extends Component {
<DropdownMenu>
{this.props.applications
.filter(app => app !== "*")
.map(app => <DropdownItem onClick={() => this._onAppSelect(app)}>{app}</DropdownItem>)}
.map(app => <DropdownItem key={app} onClick={() => this._onAppSelect(app)}>{app}</DropdownItem>)}
<DropdownItem divider />
<DropdownItem onClick={() => this._onAppSelect("*")}>All Applications</DropdownItem>
</DropdownMenu>
Expand Down
15 changes: 13 additions & 2 deletions src/utils/CentralConfigAPIUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@ class CentralConfigAPIUtils {

constructor()
{
this.baseUrl = "";
let baseUrl = "";

// If our current url contains /ui assume we're running
// as part of a centralconfig service
// Strip the /ui off to get the base url:
if(window.location.href.includes("/ui"))
{
baseUrl = window.location.href.substring(0, window.location.href.indexOf("/ui"));
}

this.baseUrl = baseUrl;

// Do a 'truthy' check to see if the config item is set
// Confused? See https://stackoverflow.com/a/5515349/19020
if(appconfig.serviceBaseHostPort)
{
this.baseUrl = `//${appconfig.serviceBaseHostPort}`;
}
}

}

// Gets all configuration items from the server
Expand Down

0 comments on commit c45833f

Please sign in to comment.