Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Nov 16, 2021
1 parent 07b74a5 commit 96e5463
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/FiltersBlock/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const providerSchema = {
},
url: {
title: 'Provider url',
widget: 'url',
widget: 'object_by_path',
},
},
required: [],
Expand Down
6 changes: 5 additions & 1 deletion src/components/manage/Blocks/IndustryMap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,18 @@ export const getLocationExtent = (data) => {
export const getSiteExtent = (data) => {
const db_version =
process.env.RAZZLE_DB_VERSION || config.settings.db_version || 'latest';

return axios.get(
`${config.settings.providerUrl}?${getEncodedQueryString(`SELECT
MIN(shape_wm.STX) AS MIN_X,
MIN(shape_wm.STY) AS MIN_Y,
MAX(shape_wm.STX) AS MAX_X,
MAX(shape_wm.STY) AS MAX_Y
FROM [IED].[${db_version}].[SiteMap]
WHERE [siteName] COLLATE Latin1_General_CI_AI LIKE '%${data.text}%'`)}`,
WHERE [siteName] COLLATE Latin1_General_CI_AI LIKE '%${data.text.replace(
"'",
"''",
)}%'`)}`,
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/IndustryMap/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const providerSchema = {
},
url: {
title: 'Provider url',
widget: 'url',
widget: 'object_by_path',
},
},
required: [],
Expand Down
6 changes: 5 additions & 1 deletion src/components/manage/Blocks/NavigationBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const View = ({ location, data, navigation }) => {
{items.map((item) => (
<Menu.Item
key={item.url}
active={pathname.includes(getBaseUrl(item.url))}
active={
data.isExact
? pathname === item.url
: pathname.includes(getBaseUrl(item.url))
}
>
<UniversalLink
href={`${item.url}${location.search}`}
Expand Down
6 changes: 5 additions & 1 deletion src/components/manage/Blocks/NavigationBlock/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
{
id: 'default',
title: 'Default',
fields: ['ignoreScroll', 'parent', 'pages'],
fields: ['ignoreScroll', 'isExact', 'parent', 'pages'],
},
],
properties: {
Expand All @@ -38,6 +38,10 @@ export default {
schema: pagesSchema,
widget: 'object_list',
},
isExact: {
title: 'Is exact',
type: 'boolean',
},
ignoreScroll: {
title: 'Ignore scroll',
type: 'boolean',
Expand Down
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/PollutantIndex/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const providerSchema = {
},
url: {
title: 'Provider url',
widget: 'url',
widget: 'object_by_path',
},
},
required: [],
Expand Down
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/SiteTableau/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default (config, provider_keys = []) => ({
},
provider_url: {
title: 'Data provider',
widget: 'url',
widget: 'object_by_path',
},
allowedParams: {
title: 'Allowed params',
Expand Down

0 comments on commit 96e5463

Please sign in to comment.