Skip to content

Commit

Permalink
relative api url
Browse files Browse the repository at this point in the history
  • Loading branch information
azahnen committed May 3, 2018
1 parent ae2bb67 commit 6912265
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/apis/ServiceApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
import { normalizeServices, normalizeServiceConfigs } from './ServiceNormalizer'

const API_URL = '../rest/admin/services/';
const VIEW_URL = '../rest/services/';

const ServiceApi = {

URL: API_URL,
VIEW_URL: VIEW_URL,

getServicesQuery: function() {
return {
Expand Down
14 changes: 8 additions & 6 deletions src/components/presentational/ServiceActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import TrashIcon from 'grommet/components/icons/base/Trash';
import LayerForm from '../common/LayerForm';
import Paragraph from 'grommet/components/Paragraph';

import ServiceApi from '../../apis/ServiceApi'



export default class ServiceActions extends Component {
Expand Down Expand Up @@ -147,15 +149,15 @@ export default class ServiceActions extends Component {
plain={ true }
icon={ <MapLocation /> }
label="View"
href={ `/rest/services/${service.id}/` }
href={ `${ServiceApi.VIEW_URL}${service.id}/` }
target="_blank" />
{ stateControls }
{ /*<Button align="start"
plain={ true }
icon={ <EditIcon /> }
label="Edit"
onClick={ this._onEdit }
a11yTitle={ `Edit ${service.name} Virtual Machine` } />*/ }
plain={ true }
icon={ <EditIcon /> }
label="Edit"
onClick={ this._onEdit }
a11yTitle={ `Edit ${service.name} Virtual Machine` } />*/ }
<Button align="start"
plain={ true }
icon={ <TrashIcon /> }
Expand Down

0 comments on commit 6912265

Please sign in to comment.