Skip to content

Commit

Permalink
[MIM-1882] Mim 1882 highmaps options (#2822)
Browse files Browse the repository at this point in the history
* Remove Kartdata fra tabell as source in highmaps

* Remove unused import of useEffect hook in highmap
  • Loading branch information
johnnadeluy authored and Carl-OW committed Jul 24, 2024
1 parent 829fb2e commit dd88d68
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 30 deletions.
44 changes: 17 additions & 27 deletions src/main/resources/site/content-types/highmap/highmap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<content-type>
<display-name>Highmap</display-name>
<super-type>base:structured</super-type>

<form>
<field-set>
<label>Beskrivelse</label>
Expand Down Expand Up @@ -34,7 +34,7 @@
</include>
</config>
<help-text>Lim inn (Ctrl-V) en tabell rett fra Excel. Hvis denne er fylt ut vil den gjelde istedenfor eget felt lengre ned</help-text>
</input>
</input>
</items>
</option>
<option name="tbprocessor">
Expand All @@ -48,39 +48,29 @@
</option>
</options>
</option-set>

<field-set>
<label>Tallkilde</label>
<label>Kartgrunnlag</label>
<items>
<input name="mapFile" type="MediaSelector">
<label>Kart fil (json format)</label>
<config>
<config>
<allowContentType>media:code</allowContentType>
</config>
<help-text>Velg kartet som skal brukes</help-text>
</input>
<input name="htmlTable" type="HtmlArea">
<label>Kartdata fra tabell - BRUK VALG UNDER DATAKILDE!!</label>
<occurrences minimum="0" maximum="1"/>
<config>
<include>
Bold Italic Underline Strike Subscript Superscript Cut Copy Blockquote
</include>
</config>
<help-text>Lim inn (Ctrl-V) en tabell rett fra Excel. Tabeller bør være så enkle som mulig</help-text>
</input>
<input name="mapDataSecondColumn" type="Checkbox">
<label>Andre kolonne i tabell inneholder kartdata (kommunenavn, fylkenavn, osv)</label>
</input>
</items>
</field-set>

<field-set>
<label>Terskelverdier</label>
<items>
<input name="thresholdValues" type="TextLine">
<label>Terskelverdi</label>
<occurrences minimum="0" maximum="4"/>
<label>Terskelverdi</label>
<occurrences minimum="0" maximum="4"/>
</input>
</items>
</field-set>
Expand Down Expand Up @@ -111,7 +101,7 @@
<label>Start-farge</label>
<occurrences minimum="1" maximum="1"/>
<config>
<service>colorPreview</service>
<service>colorPreview</service>
</config>
<help-text>Angi hex for farge på formen #000000 og velg forhåndsvisningen som dukker opp</help-text>
</input>
Expand All @@ -128,7 +118,7 @@
<label>Farge</label>
<occurrences minimum="1" maximum="1"/>
<config>
<service>colorPreview</service>
<service>colorPreview</service>
</config>
<help-text>Angi hex for farge på formen #000000 og velg forhåndsvisningen som dukker opp</help-text>
</input>
Expand All @@ -138,7 +128,7 @@
<label>Slutt-farge</label>
<occurrences minimum="1" maximum="1"/>
<config>
<service>colorPreview</service>
<service>colorPreview</service>
</config>
<help-text>Angi hex for farge på formen #000000 og velg forhåndsvisningen som dukker opp</help-text>
</input>
Expand All @@ -159,7 +149,7 @@
<label>Farge</label>
<occurrences minimum="1" maximum="1"/>
<config>
<service>colorPreview</service>
<service>colorPreview</service>
</config>
</input>
</items>
Expand All @@ -168,7 +158,7 @@
</option>

</options>
</option-set>
</option-set>
<input name="numberDecimals" type="TextLine">
<label>Antall desimalplasser som vises</label>
<config>
Expand All @@ -189,7 +179,7 @@
</input>
</items>
</field-set>

<field-set>
<label>Tegnforklaring</label>
<items>
Expand Down Expand Up @@ -226,9 +216,9 @@
</input>
</items>
</item-set>
</items>
</items>
</field-set>

<field-set>
<label>Fotnoter</label>
<items>
Expand All @@ -239,6 +229,6 @@
</input>
</items>
</field-set>

</form>
</content-type>
2 changes: 1 addition & 1 deletion src/main/resources/site/parts/highmap/Highmap.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import React from 'react'
import Highcharts from 'highcharts'
import HighchartsReact from 'highcharts-react-official'
import PropTypes from 'prop-types'
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/site/parts/highmap/highmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ function getTableData(highmap: Content<Highmap>): Array<RowValue[]> {
} else if (highmap.data.dataSource?._selected === DataSourceType.TBPROCESSOR) {
return getTBMLData(highmap)
}
} else if (highmap.data.htmlTable) {
return getHtmlTableData(highmap.data.htmlTable)
}
return []
}
Expand Down

0 comments on commit dd88d68

Please sign in to comment.