@dhis2/app-service-data 3.14.6 → 3.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/cjs/links/RestAPILink/queryToRequestOptions/textPlainMatchers.js +2 -2
- package/build/cjs/links/RestAPILink/queryToRequestOptions/textPlainMatchers.test.js +10 -0
- package/build/es/links/RestAPILink/queryToRequestOptions/textPlainMatchers.js +2 -2
- package/build/es/links/RestAPILink/queryToRequestOptions/textPlainMatchers.test.js +10 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,4 +8,4 @@ This library is intended for use with the [DHIS2 Application Platform](https://g
|
|
|
8
8
|
|
|
9
9
|
This package is internal to `@dhis2/app-runtime` and generally should not be installed independently.
|
|
10
10
|
|
|
11
|
-
See [the docs](https://
|
|
11
|
+
See [the docs](https://developers.dhis2.org/docs/app-runtime/getting-started) for more.
|
|
@@ -128,13 +128,13 @@ const isMetadataPackageInstallation = (type, _ref9) => {
|
|
|
128
128
|
return type === 'create' && resource === 'synchronization/metadataPull';
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
// POST to 'indicators/expression/description' or '
|
|
131
|
+
// POST to 'indicators/expression/description', 'programIndicator/expression/description', or 'validationRules/expression/description' (validate an expression)
|
|
132
132
|
exports.isMetadataPackageInstallation = isMetadataPackageInstallation;
|
|
133
133
|
const isExpressionDescriptionValidation = (type, _ref0) => {
|
|
134
134
|
let {
|
|
135
135
|
resource
|
|
136
136
|
} = _ref0;
|
|
137
|
-
const pattern = /^(indicators|programIndicators)\/expression\/description$/;
|
|
137
|
+
const pattern = /^(indicators|programIndicators|validationRules)\/expression\/description$/;
|
|
138
138
|
return type === 'create' && pattern.test(resource);
|
|
139
139
|
};
|
|
140
140
|
|
|
@@ -187,6 +187,16 @@ describe('isExpressionDescriptionValidation', () => {
|
|
|
187
187
|
resource: 'programIndicators/expression/somethingelse'
|
|
188
188
|
})).toBe(false);
|
|
189
189
|
});
|
|
190
|
+
it('returns true for a POST to "validationRules/expression/description"', () => {
|
|
191
|
+
expect((0, _textPlainMatchers.isExpressionDescriptionValidation)('create', {
|
|
192
|
+
resource: 'validationRules/expression/description'
|
|
193
|
+
})).toBe(true);
|
|
194
|
+
});
|
|
195
|
+
it('retuns false for a POST to a different validationRules resource', () => {
|
|
196
|
+
expect((0, _textPlainMatchers.isExpressionDescriptionValidation)('create', {
|
|
197
|
+
resource: 'validationRules/expression/somethingelse'
|
|
198
|
+
})).toBe(false);
|
|
199
|
+
});
|
|
190
200
|
});
|
|
191
201
|
describe('isFilterDescriptionValidation', () => {
|
|
192
202
|
it('returns true for a POST to "programIndicators/filter/description"', () => {
|
|
@@ -114,12 +114,12 @@ export const isMetadataPackageInstallation = (type, _ref9) => {
|
|
|
114
114
|
return type === 'create' && resource === 'synchronization/metadataPull';
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
// POST to 'indicators/expression/description' or '
|
|
117
|
+
// POST to 'indicators/expression/description', 'programIndicator/expression/description', or 'validationRules/expression/description' (validate an expression)
|
|
118
118
|
export const isExpressionDescriptionValidation = (type, _ref0) => {
|
|
119
119
|
let {
|
|
120
120
|
resource
|
|
121
121
|
} = _ref0;
|
|
122
|
-
const pattern = /^(indicators|programIndicators)\/expression\/description$/;
|
|
122
|
+
const pattern = /^(indicators|programIndicators|validationRules)\/expression\/description$/;
|
|
123
123
|
return type === 'create' && pattern.test(resource);
|
|
124
124
|
};
|
|
125
125
|
|
|
@@ -185,6 +185,16 @@ describe('isExpressionDescriptionValidation', () => {
|
|
|
185
185
|
resource: 'programIndicators/expression/somethingelse'
|
|
186
186
|
})).toBe(false);
|
|
187
187
|
});
|
|
188
|
+
it('returns true for a POST to "validationRules/expression/description"', () => {
|
|
189
|
+
expect(isExpressionDescriptionValidation('create', {
|
|
190
|
+
resource: 'validationRules/expression/description'
|
|
191
|
+
})).toBe(true);
|
|
192
|
+
});
|
|
193
|
+
it('retuns false for a POST to a different validationRules resource', () => {
|
|
194
|
+
expect(isExpressionDescriptionValidation('create', {
|
|
195
|
+
resource: 'validationRules/expression/somethingelse'
|
|
196
|
+
})).toBe(false);
|
|
197
|
+
});
|
|
188
198
|
});
|
|
189
199
|
describe('isFilterDescriptionValidation', () => {
|
|
190
200
|
it('returns true for a POST to "programIndicators/filter/description"', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2/app-service-data",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.8",
|
|
4
4
|
"main": "./build/cjs/index.js",
|
|
5
5
|
"module": "./build/es/index.js",
|
|
6
6
|
"types": "build/types/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"prop-types": "^15.7.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@dhis2/app-service-config": "3.14.
|
|
40
|
+
"@dhis2/app-service-config": "3.14.8",
|
|
41
41
|
"react": "^16.8.6 || ^18",
|
|
42
42
|
"react-dom": "^16.8.6 || ^18"
|
|
43
43
|
}
|