Skip to content

Commit

Permalink
fixes for header and SEO titles
Browse files Browse the repository at this point in the history
  • Loading branch information
edbrett committed May 14, 2018
1 parent a1ec62e commit 4527860
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/controllers/dashboards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class DashboardsController < ApplicationController

def index
@title = @location && @location["name"] || @location
@desc = "Data about forest change, tenure, forest related employment and land use in #{@location}"
@desc = "Data about forest change, tenure, forest related employment and land use in #{@title}"
# if params[:widget]
# widgets_config = JSON.parse(File.read(Rails.root.join('app', 'javascript', 'components', 'widget', 'widget-config.json')))
# widget_data = widgets_config[params[:widget]]
Expand All @@ -16,8 +16,8 @@ def index
end

def embed
@title = @location["name"]
@desc = "Data about forest change, tenure, forest related employment and land use in #{@location}"
@title = @location && @location["name"] || @location
@desc = "Data about forest change, tenure, forest related employment and land use in #{@title}"
render layout: 'application_react_embed'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getData = ({ params, dispatch, setWidgetData, widget }) => {
if (params.indicator !== 'gadm28') {
dispatch(setWidgetData({ data, widget }));
} else {
getExtent({ ...params, indicator: 'plantations' }).then(
getExtent({ ...params, forestType: 'plantations' }).then(
plantationsResponse => {
const plantationsData =
plantationsResponse.data && plantationsResponse.data.data;
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/pages/dashboards/header/header-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getHeaderData = createThunkAction(
.all([
getExtent(params),
getLoss(params),
getLoss({ ...params, indicator: 'plantations' })
getLoss({ ...params, forestType: 'plantations' })
])
.then(
axios.spread((totalExtent, totalLoss, plantationsLoss) => {
Expand Down
1 change: 1 addition & 0 deletions app/javascript/pages/dashboards/header/header-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
font-size: rem(18px);
font-weight: 400;
margin-top: rem(10px);
margin-bottom: rem(20px);
min-height: rem(90px);

b {
Expand Down

0 comments on commit 4527860

Please sign in to comment.