Skip to content

Commit

Permalink
Merge branch 'master' into feat/option-set-option-search
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Dec 14, 2023
2 parents 85fb2e3 + 5043383 commit 827b354
Show file tree
Hide file tree
Showing 28 changed files with 289 additions and 2,420 deletions.
2 changes: 1 addition & 1 deletion .tx/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[main]
host = https://www.transifex.com
lang_map = fa_AF: prs, uz@Cyrl: uz, uz@Latn: uz_Latn
lang_map = fa_AF: prs, uz@Cyrl: uz_UZ_Cyrl, uz@Latn: uz_UZ_Latn

[o:hisp-uio:p:app-maintenance:r:i18n-module-en-properties]
file_filter = src/i18n/i18n_module_<lang>.properties
Expand Down
86 changes: 86 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,89 @@
## [32.24.5](https://github.com/dhis2/maintenance-app/compare/v32.24.4...v32.24.5) (2023-12-14)


### Bug Fixes

* add in missing cache translation strings [DHIS2-15940] ([#2715](https://github.com/dhis2/maintenance-app/issues/2715)) ([f3d8e9c](https://github.com/dhis2/maintenance-app/commit/f3d8e9c5017ac631145063d15e94c4c33af5d17a))

## [32.24.4](https://github.com/dhis2/maintenance-app/compare/v32.24.3...v32.24.4) (2023-12-13)


### Bug Fixes

* fix crash when instance url contains api ([#2745](https://github.com/dhis2/maintenance-app/issues/2745)) ([4114327](https://github.com/dhis2/maintenance-app/commit/41143270de65f2c19f157593a443e0e6b50b2b51))

## [32.24.3](https://github.com/dhis2/maintenance-app/compare/v32.24.2...v32.24.3) (2023-11-26)


### Bug Fixes

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

## [32.24.2](https://github.com/dhis2/maintenance-app/compare/v32.24.1...v32.24.2) (2023-11-19)


### Bug Fixes

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

## [32.24.1](https://github.com/dhis2/maintenance-app/compare/v32.24.0...v32.24.1) (2023-11-05)


### Bug Fixes

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

# [32.24.0](https://github.com/dhis2/maintenance-app/compare/v32.23.38...v32.24.0) (2023-11-03)


### Features

* force Overlay for geojson and arcgis ([#2722](https://github.com/dhis2/maintenance-app/issues/2722)) ([87ae5e0](https://github.com/dhis2/maintenance-app/commit/87ae5e0f74c6726d33e9cd270c54797763e00d82))

## [32.23.38](https://github.com/dhis2/maintenance-app/compare/v32.23.37...v32.23.38) (2023-11-02)


### Bug Fixes

* **predictor:** fix hide when default catcombo ([37f79e3](https://github.com/dhis2/maintenance-app/commit/37f79e3ccc1cf8fa25ca5fa4b96adcac2e2c04e5))
* typo ([0f61601](https://github.com/dhis2/maintenance-app/commit/0f616015c315ee36d41e3281109c8c4765ed3fa4))
* **predictor:** update default unselected categoryoptioncombo selection ([b8d6cd2](https://github.com/dhis2/maintenance-app/commit/b8d6cd2fc521bb32c698bafcf48f77e4339b8ef6))

## [32.23.37](https://github.com/dhis2/maintenance-app/compare/v32.23.36...v32.23.37) (2023-10-22)


### Bug Fixes

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

## [32.23.36](https://github.com/dhis2/maintenance-app/compare/v32.23.35...v32.23.36) (2023-10-03)


### Bug Fixes

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

## [32.23.35](https://github.com/dhis2/maintenance-app/compare/v32.23.34...v32.23.35) (2023-09-22)


### Bug Fixes

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

## [32.23.34](https://github.com/dhis2/maintenance-app/compare/v32.23.33...v32.23.34) (2023-09-14)


### Bug Fixes

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

## [32.23.33](https://github.com/dhis2/maintenance-app/compare/v32.23.32...v32.23.33) (2023-09-08)


### Bug Fixes

* **expressionmanager:** add overflow to description ([#2683](https://github.com/dhis2/maintenance-app/issues/2683)) ([fc80bd9](https://github.com/dhis2/maintenance-app/commit/fc80bd9117429286aa947951cceaf5c302a778f5))

## [32.23.32](https://github.com/dhis2/maintenance-app/compare/v32.23.31...v32.23.32) (2023-08-15)


Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maintenance-app",
"version": "32.23.32",
"version": "32.24.5",
"description": "DHIS2 Maintenance app",
"repository": {
"type": "git",
Expand Down Expand Up @@ -81,7 +81,7 @@
"@dhis2/d2-ui-header-bar": "^1.1.4",
"@dhis2/d2-ui-sharing-dialog": "^1.0.12",
"ckeditor": "4.6.1",
"d2": "30.2.2",
"d2": "^30.2.3",
"d2-ui": "29.0.34",
"lodash": "^4.17.11",
"material-design-icons-iconfont": "^4.0.5",
Expand Down
2 changes: 2 additions & 0 deletions src/EditModel/expression/ExpressionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const styles = {
expressionDescription: {
padding: '1rem',
margin: '1rem 0',
maxHeight: '250px',
overflow: 'auto',
},
expressionMessage: {
valid: {
Expand Down
7 changes: 7 additions & 0 deletions src/config/field-overrides/externalMapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export default new Map([
return <DropDown {...props} value={'BASEMAP'} disabled />;
}

if (
props.model.mapService === 'GEOJSON_URL' ||
props.model.mapService === 'ARCGIS_FEATURE'
) {
return <DropDown {...props} value={'OVERLAY'} disabled />;
}

return <DropDown {...props} />;
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import DropDown from '../../../forms/form-fields/drop-down.js';
import { red500, grey400 } from 'material-ui/styles/colors';
import { LinearProgress } from 'material-ui';

const DEFAULT = 'default';

const DropDownLoader = ({ msg }) => (
<p
style={{
Expand All @@ -25,6 +23,8 @@ class DataElementCategoryOptionCombo extends Component {
options: [],
loading: false,
loadErrorText: '',
defaultCategoryOptionComboId: null,
hasOnlyDefaultCatCombo: false,
};
getTranslation = this.context.d2.i18n.getTranslation.bind(
this.context.d2.i18n
Expand All @@ -37,7 +37,13 @@ class DataElementCategoryOptionCombo extends Component {
prevOutputId = null;

onChange = ({ target }) => {
const value = target.value ? { id: target.value } : null;
const selectedId = target.value;
let value = selectedId ? { id: selectedId } : null;

if(selectedId === this.state.defaultCategoryOptionComboId) {
value = null
}

this.props.onChange({ target: { value } });
};

Expand Down Expand Up @@ -79,27 +85,39 @@ class DataElementCategoryOptionCombo extends Component {
this.setState({ loading: true, loadErrorText: '' });

try {
const response = await this.context.d2.models.dataElements.get(
const catComboResponse = this.context.d2.models.dataElements.get(
this.props.model.output.id,
{ fields: ['categoryCombo[categoryOptionCombos[id,name]]'] }
{ fields: ['categoryCombo[isDefault,categoryOptionCombos[id,name]]']}
);
// need to get the default categoryCombo - to be able to show the correct label in the dropdown
const defaultCatComboResponse = this.context.d2.models.categoryCombos.list({
fields: ['id', 'name', 'isDefault', 'categoryOptionCombos[id,name]'],
filter: `isDefault:eq:true`
})
const [response, defaultCatCombo] = await Promise.all([catComboResponse, defaultCatComboResponse])

const defaultCategoryOptionCombo = defaultCatCombo.toArray()[0].categoryOptionCombos.toArray()[0]
const categoryOptionCombos =
response.categoryCombo.categoryOptionCombos;
const hasOnlyDefault =

const hasOnlyDefaultCatCombo = defaultCategoryOptionCombo &&
categoryOptionCombos.length === 1 &&
categoryOptionCombos[0].name === DEFAULT;
const options = hasOnlyDefault
? []
: categoryOptionCombos.map(o => ({
text: o.name,
value: o.id,
}));

this.setState({ options, loading: false });
categoryOptionCombos[0].id === defaultCategoryOptionCombo.id;

let options = [{ text: this.getTranslation('predict_according_to_input_category_option_combo'), value: defaultCategoryOptionCombo.id }];

options = options.concat(categoryOptionCombos.map(
o => ({
text: o.name,
value: o.id,
})
));

this.setState({ options, loading: false, defaultCategoryOptionComboId: defaultCategoryOptionCombo.id, hasOnlyDefaultCatCombo });
} catch (error) {
console.error(error);
const msg = this.getTranslation('output_combo_error');
this.setState({ loading: false, loadErrorText: msg });
this.setState({ loading: false, loadErrorText: msg, hasOnlyDefaultCatCombo: false });
}
}

Expand All @@ -124,12 +142,19 @@ class DataElementCategoryOptionCombo extends Component {
return null;
}

if(this.state.hasOnlyDefaultCatCombo) {
return null;
}

const value = this.props.value && this.props.value.id || this.state.defaultCategoryOptionComboId

return (
<DropDown
labelText={this.getTranslation('output_combo')}
onChange={this.onChange}
value={this.props.value && this.props.value.id}
value={value}
options={this.state.options}
isRequired
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/i18n_module_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ value_should_be_empty_string_or_undefined=\u064a\u062c\u0628 \u0623\u0646 \u062a
value_should_be_a_url=\u064a\u062a\u0637\u0644\u0628 \u0647\u0630\u0627 \u0627\u0644\u062d\u0642\u0644 \u0639\u0646\u0648\u0627\u0646 url \u0635\u0627\u0644\u062d
value_should_be_a_relative_url=\u064a\u062a\u0637\u0644\u0628 \u0647\u0630\u0627 \u0627\u0644\u062d\u0642\u0644 \u0639\u0646\u0648\u0627\u0646 URL \u0646\u0633\u0628\u064a
value_should_be_list_of_urls=\u064a\u062a\u0637\u0644\u0628 \u0647\u0630\u0627 \u0627\u0644\u062d\u0642\u0644 \u0642\u0627\u0626\u0645\u0629 \u0639\u0646\u0627\u0648\u064a\u0646 URL
value_should_be_an_email=\u064a\u062d\u0648\u064a \u0647\u0630\u0627 \u0627\u0644\u062d\u0642\u0644 \u0639\u0646\u0648\u0627\u0646 \u0628\u0631\u064a\u062f \u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a
value_should_be_an_email=\u064a\u062c\u0628 \u0623\u0646 \u064a\u062d\u062a\u0648\u064a \u0647\u0630\u0627 \u0627\u0644\u062d\u0642\u0644 \u0639\u0644\u0649 \u0639\u0646\u0648\u0627\u0646 \u0628\u0631\u064a\u062f \u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a
value_should_be_a_number=\u064a\u062c\u0628 \u0623\u0646 \u064a\u062d\u062a\u0648\u064a \u0647\u0630\u0627 \u0627\u0644\u062d\u0642\u0644 \u0639\u062f\u062f\u0627\u064b
number_should_not_have_decimals=\u0644\u0627 \u064a\u062c\u0628 \u0623\u0646 \u064a\u0645\u0644\u0643 \u0627\u0644\u0631\u0642\u0645 \u0645\u0646\u0627\u0632\u0644 \u0639\u0634\u0631\u064a\u0629
value_not_max=\u0627\u0644\u0642\u064a\u0645\u0629 \u0643\u0628\u064a\u0631\u0629/\u0637\u0648\u064a\u0644\u0629 \u062c\u062f\u0627\u064b
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/i18n_module_cs.properties
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ value_should_be_empty_string_or_undefined=Hodnota by m\u011bla b\u00fdt pr\u00e1
value_should_be_a_url=Toto pole vy\u017eaduje platnou adresu URL
value_should_be_a_relative_url=Toto pole vy\u017eaduje relativn\u00ed adresu URL
value_should_be_list_of_urls=Toto pole vy\u017eaduje seznam adres URL
value_should_be_an_email=Toto pole obsahuje e-mailovou adresu
value_should_be_an_email=Toto pole by m\u011blo obsahovat e-mailovou adresu
value_should_be_a_number=Toto pole by m\u011blo obsahovat \u010d\u00edslo
number_should_not_have_decimals=\u010c\u00edslo by nem\u011blo m\u00edt desetinn\u00e1 m\u00edsta
value_not_max=Hodnota je p\u0159\u00edli\u0161 dlouh\u00e1 / velk\u00e1
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/i18n_module_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,9 @@ sql_view_refreshed_successfully=SQL view refreshed successfully
sql_view_refresh_error=Could not refresh SQL query
cache_strategy=Cache strategy
no_cache=No cache
cache_1_minute=Cache for 1 minute
cache_5_minutes=Cache for 5 minutes
cache_10_minutes=Cache for 10 minutes
cache_15_minutes=Cache for 15 minutes
cache_30_minutes=Cache for 30 minutes
cache_1_hour=Cache for one hour
Expand Down Expand Up @@ -2328,3 +2331,4 @@ registration_organisation_unit=Registration organisation unit
organisation_unit_field=Organisation unit field
prevent_adding_new_events_to_stage=Prevent adding new events to stage
sorting_is_disabled_when_filter_is_applied=Sorting is diabled when a filter is applied
predict_according_to_input_category_option_combo=Predict according to input category option combo
Loading

0 comments on commit 827b354

Please sign in to comment.