Skip to content

Commit

Permalink
Merge branch 'master' into DHIS2-17994/org-unit-roots
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Nov 13, 2024
2 parents ebcecce + 6f31f66 commit b978e2a
Show file tree
Hide file tree
Showing 33 changed files with 787 additions and 185 deletions.
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
## [32.33.1](https://github.com/dhis2/maintenance-app/compare/v32.33.0...v32.33.1) (2024-11-10)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([77a38d7](https://github.com/dhis2/maintenance-app/commit/77a38d7c9f0148353dfba5c639ee18213e78fb73))

# [32.33.0](https://github.com/dhis2/maintenance-app/compare/v32.32.3...v32.33.0) (2024-11-05)


### Features

* add max length to inputs for title and subtitle ([5fdcc44](https://github.com/dhis2/maintenance-app/commit/5fdcc44590d3596906d7e48a0b7291f7fd78419c))

## [32.32.3](https://github.com/dhis2/maintenance-app/compare/v32.32.2...v32.32.3) (2024-11-04)


### Bug Fixes

* **analyticstablehooks:** Slightly better UI and label language ([#2969](https://github.com/dhis2/maintenance-app/issues/2969)) ([05831ec](https://github.com/dhis2/maintenance-app/commit/05831ec6439222f89f840a82e808801c9d0b2a58))

## [32.32.2](https://github.com/dhis2/maintenance-app/compare/v32.32.1...v32.32.2) (2024-11-04)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([6a59f83](https://github.com/dhis2/maintenance-app/commit/6a59f839fcdfdceaf67e2433f3738fce5a9f0d81))

## [32.32.1](https://github.com/dhis2/maintenance-app/compare/v32.32.0...v32.32.1) (2024-10-27)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([ab9726e](https://github.com/dhis2/maintenance-app/commit/ab9726edbc22bde89e6fefbbb73402ba005d57ec))

# [32.32.0](https://github.com/dhis2/maintenance-app/compare/v32.31.15...v32.32.0) (2024-10-23)


### Bug Fixes

* change text alignment in data set display options from left and right to line start and line end ([99806d0](https://github.com/dhis2/maintenance-app/commit/99806d0ab191707002758a57121899a05e0f58cb))
* small fixes ([337536a](https://github.com/dhis2/maintenance-app/commit/337536aac5762c9a713e32bc00e3d9cc98b749ae))


### Features

* add option to enter custom text to data sets ([a94816f](https://github.com/dhis2/maintenance-app/commit/a94816f96476425a0de95a186a6a28511656b923))
* add radio to decide how to align title and subtitle ([7a73419](https://github.com/dhis2/maintenance-app/commit/7a73419cc1a46b372ca11b1af71208ad29f16107))
* fix copy for dataset title and subtitle ([feae172](https://github.com/dhis2/maintenance-app/commit/feae172a4bb686ed88569fa976f5bb7b5de1d603))

## [32.31.15](https://github.com/dhis2/maintenance-app/compare/v32.31.14...v32.31.15) (2024-10-20)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maintenance-app",
"version": "32.31.15",
"version": "32.33.1",
"description": "DHIS2 Maintenance app",
"repository": {
"type": "git",
Expand Down
168 changes: 136 additions & 32 deletions src/config/field-overrides/dataSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import Checkbox from '../../forms/form-fields/check-box';
import {RadioButton, RadioButtonGroup} from "material-ui/RadioButton";
import addD2Context from 'd2-ui/lib/component-helpers/addD2Context';
import log from "loglevel";
import TextField from "material-ui/TextField/TextField";

class RenderAsTabsSettings extends React.Component {
constructor(props, context) {
super(props);
this.state = {
displayOptions: this.parseDisplayOptions()
displayOptions: this.parseDisplayOptions(),
};
this.translate = context.d2.i18n.getTranslation.bind(
context.d2.i18n
Expand All @@ -30,20 +31,21 @@ class RenderAsTabsSettings extends React.Component {
}
}

updateTabsDirection = (tabsDirection) => {
const newDisplayOptions = {
...this.state.displayOptions,
tabsDirection
}
updateDisplayOption = (newDisplayOptions) => {
this.setState({displayOptions: newDisplayOptions});
this.props.model.displayOptions = JSON.stringify(newDisplayOptions)
}

onDisplayOptionsChanged = (event) => {
const tabsDirection = event.target.value
this.updateTabsDirection(tabsDirection)
const newDisplayOptions = {
...this.state.displayOptions,
tabsDirection
}
this.updateDisplayOption(newDisplayOptions)
}


onRenderAsTabsChanged = (event) => {
const renderAsTabs = event.target.value
const tabsDirection =
Expand All @@ -52,39 +54,141 @@ class RenderAsTabsSettings extends React.Component {
: undefined

this.props.onChange({ target: { value: renderAsTabs } });
this.updateTabsDirection(tabsDirection)
const newDisplayOptions = {
...this.state.displayOptions,
tabsDirection
}
this.updateDisplayOption(newDisplayOptions)
}

onAddCustomTextChanged = (event) => {
const addCustomText = event.target.value
const customText =
addCustomText
? {header: undefined, subheader: undefined, align: 'center'}
: undefined

const newDisplayOptions = {
...this.state.displayOptions,
customText
}
this.updateDisplayOption(newDisplayOptions)
}

onCustomTextChanged = (event, field) => {
const customText =
{...this.state.displayOptions.customText, [field]: event.target.value}

const newDisplayOptions = {
...this.state.displayOptions,
customText
}
this.updateDisplayOption(newDisplayOptions)
}

onCustomTextAlignmentChanged = (event) => {
this.onCustomTextChanged(event, 'align')
}


onCustomTextHeaderChanged = (event) => {
this.onCustomTextChanged(event, 'header')
}

onCustomTextSubheaderChanged = (event) => {
this.onCustomTextChanged(event, 'subheader')
}

render() {
const state = this.state;
const props = this.props;
const customTextCssStyles = {
display: 'flex',
flexDirection: 'column',
marginLeft: '16px'
};
return <div>
<Checkbox
labelText={this.translate('render_as_tabs')}
value={props.value}
onChange={this.onRenderAsTabsChanged}
/>
{props.value &&
<RadioButtonGroup
onChange={this.onDisplayOptionsChanged}
name="tabsDirection"
defaultSelected={
(state.displayOptions && state.displayOptions.tabsDirection) || 'horizontal' }
>
<RadioButton
key='horizontal'
value='horizontal'
label={this.translate('horizontal')}
style={{margin: '10px'}}
/>
<RadioButton
key='vertical'
value='vertical'
label={this.translate('vertical')}
style={{margin: '10px'}}
<div>
<Checkbox
labelText={this.translate('render_as_tabs')}
value={props.value}
onChange={this.onRenderAsTabsChanged}
/>
</RadioButtonGroup>}
{props.value &&
<RadioButtonGroup
onChange={this.onDisplayOptionsChanged}
name="tabsDirection"
defaultSelected={
(state.displayOptions && state.displayOptions.tabsDirection) || 'horizontal'}
>
<RadioButton
key='horizontal'
value='horizontal'
label={this.translate('horizontal')}
style={{margin: '10px'}}
/>
<RadioButton
key='vertical'
value='vertical'
label={this.translate('vertical')}
style={{margin: '10px'}}
/>
</RadioButtonGroup>}
</div>
<div>
<Checkbox
labelText={this.translate('add_custom_text')}
value={state.displayOptions && state.displayOptions.customText !== undefined}
onChange={this.onAddCustomTextChanged}
/>

{state.displayOptions && state.displayOptions.customText &&
<RadioButtonGroup
onChange={this.onCustomTextAlignmentChanged}
name="customTextAlignment"
defaultSelected={
(state.displayOptions && state.displayOptions.customText && state.displayOptions.customText.align) || 'center'}
>
<RadioButton
key='line-start'
value='line-start'
label={this.translate('line_start')}
style={{margin: '10px'}}
/>
<RadioButton
key='center'
value='center'
label={this.translate('center')}
style={{margin: '10px'}}
/>
<RadioButton
key='line-end'
value='line-end'
label={this.translate('line_end')}
style={{margin: '10px'}}
/>
</RadioButtonGroup>}

{state.displayOptions && state.displayOptions.customText &&
<div style={customTextCssStyles}>
<TextField
value={(state.displayOptions && state.displayOptions.customText &&
state.displayOptions.customText.header) || ""}
fullWidth={false}
onChange={this.onCustomTextHeaderChanged}
floatingLabelText={this.translate('data_set_title')}
maxLength={500}
/>
<TextField
value={(state.displayOptions && state.displayOptions.customText &&
state.displayOptions.customText.subheader) || ""}
fullWidth={false}
onChange={this.onCustomTextSubheaderChanged}
floatingLabelText={this.translate('data_set_subtitle')}
maxLength={500}
/>
</div>}
</div>
</div>
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/config/field-overrides/externalMapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,17 @@ export default new Map([
},
},
],
[
'mapService',
{
required: true,
component: props => {
const options = props.options.filter(
option => option.value !== 'ARCGIS_FEATURE'
);

return <DropDown {...props} options={options} />;
},
},
],
]);
4 changes: 2 additions & 2 deletions src/config/field-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ export default new Map([
when: {
field: 'phase',
operator: 'PREDICATE',
value: (phase) => phase === 'ANALYTICS_TABLE_POPULATED'
value: (phase) => phase != 'RESOURCE_TABLE_POPULATED'
},
operations: [{
type: 'HIDE_FIELD',
Expand All @@ -961,7 +961,7 @@ export default new Map([
when: {
field: 'phase',
operator: 'PREDICATE',
value: (phase) => phase === 'RESOURCE_TABLE_POPULATED'
value: (phase) => phase != 'ANALYTICS_TABLE_POPULATED'
},
operations: [{
type: 'HIDE_FIELD',
Expand Down
16 changes: 11 additions & 5 deletions src/i18n/i18n_module_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ render_options_as_radio=\u0639\u0631\u0636 \u0627\u0644\u062e\u064a\u0627\u0631\
render_as_tabs=\u0639\u0631\u0636 \u0627\u0644\u0623\u0642\u0633\u0627\u0645 \u0643\u062a\u0628\u0648\u064a\u0628\u0627\u062a
horizontal=Horizontal
vertical=Vertical
add_custom_text=Add custom title/subtitle
data_set_title=\u0627\u0644\u0639\u0646\u0648\u0627\u0646
data_set_subtitle=Subtitle
render_horizontally=\u0639\u0631\u0636 \u0631\u0623\u0633\u064a
compulsory_fields_complete_only=\u064a\u064f\u0633\u0645\u062d \u0628\u0627\u0644\u0625\u0643\u0645\u0627\u0644 \u0641\u0642\u0637 \u0641\u064a \u062d\u0627\u0644\u0629 \u0645\u0644\u0621 \u0627\u0644\u062d\u0642\u0648\u0644 \u0627\u0644\u0625\u0644\u0632\u0627\u0645\u064a\u0629
auto_save_data_entry_forms=\u062d\u0641\u0638 \u062a\u0644\u0642\u0627\u0626\u064a \u0644\u0646\u0645\u0627\u0630\u062c \u0625\u062f\u062e\u0627\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a
Expand Down Expand Up @@ -708,6 +711,9 @@ edit_right_side= \u062a\u0639\u062f\u064a\u0644 \u0627\u0644\u0637\u0631\u0641 \
select_operator= \u062a\u062d\u062f\u064a\u062f \u0627\u0644\u0639\u0627\u0645\u0644
left= \u0627\u0644\u0623\u064a\u0633\u0631
right= \u0627\u0644\u0623\u064a\u0645\u0646
center= \u0627\u0644\u0645\u0631\u0643\u0632
line_start= Line start
line_end= Line end
textual_expression_description= \u0648\u0635\u0641 \u0627\u0644\u062a\u0639\u0628\u064a\u0631 \u0627\u0644\u0646\u0635\u064a
edit_validation_rule= \u062a\u0639\u062f\u064a\u0644 \u0642\u0627\u0639\u062f\u0629 \u0627\u0644\u062a\u062d\u0642\u0642
validation_rule= \u0642\u0627\u0639\u062f\u0629 \u0627\u0644\u062a\u062d\u0642\u0642
Expand Down Expand Up @@ -2371,17 +2377,17 @@ skip_in_analytics=Skip in analytics
analytics_table_hook=Analytics table hooks
intro_analytics_table_hook=Configure hooks in SQL that run during the analytics process
analytics_table_hook_management=Analytics table hooks management
phase=Phase that the SQL script should be invoked
resource_table_populated=After the temporary resource tables have been populated
analytics_table_populated=After the temporary analytics tables have been populated
resource_table_type=Resource table
phase=After population of which temporary tables should the SQL script be invoked?
resource_table_populated=\u062c\u062f\u0627\u0648\u0644 \u0627\u0644\u0645\u0635\u0627\u062f\u0631
analytics_table_populated=\u062c\u062f\u0627\u0648\u0644 \u0627\u0644\u062a\u062d\u0644\u064a\u0644\u0627\u062a
resource_table_type=Which resource table
org_unit_structure=\u0647\u064a\u0643\u0644\u064a\u0629 \u0627\u0644\u0648\u062d\u062f\u0629 \u0627\u0644\u062a\u0646\u0638\u064a\u0645\u064a\u0629
data_set_org_unit_category=Data set organisation unit category
category_option_combo_name=Category option combo name
org_unit_group_set_structure=\u0647\u064a\u0643\u0644\u064a\u0629 \u062d\u0632\u0645\u0629 \u0645\u062c\u0645\u0648\u0639\u0627\u062a \u0627\u0644\u0648\u062d\u062f\u0627\u062a \u0627\u0644\u062a\u0646\u0638\u064a\u0645\u064a\u0629
data_approval_remap_level=Data approval remap level
data_approval_min_level=Data approval minimum level
analytics_table_type=Analytics table
analytics_table_type=Which analytics table
data_value=Data value
completeness=Completeness
completeness_target=Completeness target
Expand Down
Loading

0 comments on commit b978e2a

Please sign in to comment.