Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build-and-pre-release-wordpress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: v
release_branches: production,release/*
pre_release_branches: main,task/*,feature/*,bugfix/*,feat/*,fix/*
default_prerelease_bump: prerelease
release_branches: __no-stable-release-branch__
pre_release_branches: .*
Comment thread
timothygachengo marked this conversation as resolved.
append_to_pre_release_tag: rc
dry_run: "true"

Expand Down
11 changes: 11 additions & 0 deletions plugins/wp-react-blocks-plugin/blocks/map/APIConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export class APIConfig extends Component {
filters,
dimension1,
dimension2,
dimension3,
type,
types
}
Expand Down Expand Up @@ -223,6 +224,16 @@ export class APIConfig extends Component {
options={allDimensions}
/>
</PanelRow>
<PanelRow>
<SelectControl
label={__('Additional Dimension')}
value={[dimension3]}
onChange={(value) => {
setAttributes({dimension3: value})
}}
options={allDimensions}
/>
</PanelRow>
</PanelBody>,
<Measures onSetSingleMeasure={this.onSetSingleMeasure} onMeasuresChange={this.onMeasuresChange} {...this.props} currentType={currentType}/>,
<>
Expand Down
12 changes: 7 additions & 5 deletions plugins/wp-react-blocks-plugin/blocks/map/BlockEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
app,
dimension1,
dimension2,
dimension3,
legendBreaks,
mainLayerId,
mappingField,
Expand All @@ -446,7 +447,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
} = this.props;

const {mapFiles} = this.state;
const levels = [dimension1, dimension2]
const levels = [dimension1, dimension2, dimension3]
const source = levels.filter(l => l != 'none' && l != null).join('/')
const validLegendBreaks = legendBreaks.filter(b => b.min || b.max);
let params = {}
Expand Down Expand Up @@ -489,6 +490,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
app: app,
dimension1: 'none',
dimension2: 'none',
dimension3: 'none',
filters: []
})
}}
Expand Down Expand Up @@ -558,7 +560,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
onChange={(value) => {this.setValue(file.value, 'index', value)}} max={10} type="number" />}
</div>

{app != 'csv' &&
{app !== 'csv' &&
<PanelBody initialOpen={false} title={__("Localize Layer")}>
<PanelRow>
<p style={{fontSize: '12px', fontStyle: 'italic', color: '#666', margin: '0'}}>
Expand Down Expand Up @@ -676,7 +678,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
</PanelBody>

</PanelBody>
{app != 'csv' &&
{app !== 'csv' &&
<APIConfig
allDimensions={this.state.dimensions || []}
allFilters={this.state.filters || []}
Expand All @@ -694,7 +696,7 @@ class BlockEdit extends BlockEditWithAPIMetadata {
<Settings {...this.props} locations = {this.state.locations}> </Settings>
<LegendBreaks {...this.props} allMeasures={this.state.measures || []} app = {app}/>
<MapSymbols {...this.props} allMeasures={this.state.measures || []} app = {app} locations = {this.state.locations}/>
<Tooltips {...this.props} allMeasures={this.state.measures || []} app = {app} locations = {this.state.locations}></Tooltips>
<Tooltips {...this.props} allMeasures={this.state.measures || []} app = {app} locations = {this.state.locations}></Tooltips>
{mapType == "POINTS_MAP" &&
<PanelBody title="Point Map Config">
<PanelRow>
Expand Down Expand Up @@ -798,4 +800,4 @@ const Edit = (props) => {


}
export default Edit;
export default Edit;
6 changes: 4 additions & 2 deletions plugins/wp-react-blocks-plugin/blocks/map/BlockSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const SaveComponent = (props) => {
dataSourceLabel,
dimension1,
dimension2,
dimension3,
measures,
filters,
app,
Expand Down Expand Up @@ -73,7 +74,7 @@ const SaveComponent = (props) => {
zoomOnFilterField,
labelsExclusionList,
noDataText,
customMeasureLabels,
customMeasureLabels,
showShadingLayerLabels,
dvzProxyDatasetId
}
Expand All @@ -83,7 +84,7 @@ const SaveComponent = (props) => {
className: 'viz component map'
});

const levels = [dimension1, dimension2]
const levels = [dimension1, dimension2, dimension3]
const source = levels.filter(l => l != 'none' && l != null).join('/')
const validLegendBreaks = legendBreaks.filter(b => b.min || b.max);

Expand Down Expand Up @@ -152,6 +153,7 @@ const SaveComponent = (props) => {
data-file-type={fileType}
data-dimension1={dimension1}
data-dimension2={dimension2}
data-dimension3={dimension3}
data-enabled-layers={encodeURIComponent(JSON.stringify(enabledLayers))}
Comment thread
timothygachengo marked this conversation as resolved.
data-point-label-color={pointLabelColor}
data-point-label-format={pointLabelFormat}
Expand Down
3 changes: 2 additions & 1 deletion plugins/wp-react-blocks-plugin/blocks/map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ A Gutenberg block that renders an interactive choropleth/symbol map by embedding
| `app` | `String` | `"csv"` | Data source identifier (`"csv"` or an API app slug). |
| `csv` | `String` | `""` | Inline CSV data used when `app` is `"csv"`. |
| `dimension1` | `String` | `"zone"` | Primary geographic dimension field. |
| `dimension2` | `String` | `"gender"` | Secondary dimension field (e.g. for disaggregation). |
| `dimension2` | `String` | `"none"` | Secondary dimension field (e.g. for disaggregation). |
| `dimension3` | `String` | `"none"` | Additional dimension (can be for tooltips) |
| `measures` | `Array` | `[]` | Measure fields to visualise on the map. Must be configured; no measure is pre-selected by default. |
| `filters` | `Array` | `[]` | Active filter values passed as query params to the data API. |
| `mapFile` | `String` | `""` | Path (relative to the UI app) to the TopoJSON map file. |
Expand Down
Loading
Loading