Skip to content

Commit

Permalink
Removed all references to the legacy 'shortcode' feature in FeatureIn…
Browse files Browse the repository at this point in the history
…fo, also removed unused deps.
  • Loading branch information
jacobwod committed Aug 16, 2023
1 parent 4e0eaed commit 436afad
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 255 deletions.
2 changes: 0 additions & 2 deletions new-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"@fontsource/roboto": "^5.0.3",
"@jonkoops/matomo-tracker": "^0.7.0",
"@mui/icons-material": "^5.11.16",
"@mui/lab": "^5.0.0-alpha.134",
"@mui/material": "^5.13.6",
"@mui/x-data-grid": "^5.17.14",
"@nieuwlandgeo/sldreader": "^0.2.17",
Expand Down Expand Up @@ -73,7 +72,6 @@
"react-number-format": "^4.9.4",
"react-rnd": "^10.3.7",
"react-scroll": "^1.8.9",
"recharts": "^2.1.16",
"rehype-raw": "^6.1.1",
"remark-gfm": "^3.0.1",
"x2js": "^3.4.4",
Expand Down
93 changes: 0 additions & 93 deletions new-client/src/components/Diagram.js

This file was deleted.

64 changes: 2 additions & 62 deletions new-client/src/components/FeatureInfo/FeatureInfoContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,36 +161,6 @@ class FeatureInfoContainer extends React.PureComponent {
);
}

// shortcode(str) {
// const codes = [];
// let shortcodes = str.match(/\[(.*?)\]/g);
// shortcodes = shortcodes === null ? [] : shortcodes;

// if (shortcodes) {
// shortcodes.forEach((code) => {
// str = str.replace(code, "");
// var params = code.replace("[", "").replace("]", "").split(" ");
// var c = {};

// params.forEach((param, i) => {
// if (i === 0) {
// c.shortcode = param;
// } else {
// let parts = param.split("=");
// c[parts[0]] = param.replace(parts[0] + "=", "").replace(/"/g, "");
// }
// });
// codes.push(c);
// });
// return {
// str: str,
// codes: codes,
// };
// } else {
// return;
// }
// }

getFeatureProperties = (feature) => {
let properties = feature.getProperties();
properties = this.featurePropsParsing.extractPropertiesFromJson(properties);
Expand All @@ -209,17 +179,6 @@ class FeatureInfoContainer extends React.PureComponent {
// an informative feature-info.
const { displayName: caption, infoclickDefinition: markdown } =
getInfoClickInfoFromLayerConfig(feature, layer);
// TODO: shortCodes, remove?
const shortcodes = [];
// Disabled shortcodes for now as they mess with Markdown tags
// for Links and Imgs that use "[" and "]".
// if (markdown) {
// let transformed = this.shortcode(markdown);
// if (transformed) {
// shortcodes = transformed.codes;
// markdown = transformed.str;
// }
// }

// When we've grabbed the markdown-definition for the layer, we can create the
// information that we want to display to the user by combining the definition with
Expand All @@ -232,7 +191,6 @@ class FeatureInfoContainer extends React.PureComponent {
value: value,
loading: false,
caption: caption,
shortcodes: shortcodes,
selectedIndex: newIndex,
markdown: markdown,
},
Expand All @@ -252,30 +210,12 @@ class FeatureInfoContainer extends React.PureComponent {
}
};

// renderShortcodes(shortcodes, feature) {
// return shortcodes.map((shortcode, i) => {
// switch (shortcode.shortcode) {
// case "diagram":
// return (
// <Diagram key={i} source={shortcode.source} feature={feature} />
// );
// case "table":
// return (
// <HajkTable key={i} source={shortcode.source} feature={feature} />
// );
// default:
// return null;
// }
// });
// }

isReadyToShowInfo = () => {
const { caption, value, loading, shortcodes } = this.state;
return caption && !loading && value && shortcodes;
const { caption, value, loading } = this.state;
return caption && !loading && value;
};

renderFeatureInformation = () => {
// const { caption, value, shortcodes, markdown } = this.state;
const { caption, value } = this.state;

return (
Expand Down
98 changes: 0 additions & 98 deletions new-client/src/components/Table.js

This file was deleted.

0 comments on commit 436afad

Please sign in to comment.