@dhis2/analytics 21.9.1 → 21.10.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [21.10.0](https://github.com/dhis2/analytics/compare/v21.9.1...v21.10.0) (2024-04-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * disable Save button when onSave not passed (TECH-1013) ([#1652](https://github.com/dhis2/analytics/issues/1652)) ([b8e17fb](https://github.com/dhis2/analytics/commit/b8e17fba1243188ff28b0813e26528f2b1810553))
7
+
1
8
  ## [21.9.1](https://github.com/dhis2/analytics/compare/v21.9.0...v21.9.1) (2023-10-05)
2
9
 
3
10
 
@@ -193,9 +193,9 @@ const FileMenu = ({
193
193
  }), /*#__PURE__*/_react.default.createElement(_ui.MenuItem, {
194
194
  label: fileObject !== null && fileObject !== void 0 && fileObject.id ? _index.default.t('Save') : _index.default.t('Save…'),
195
195
  icon: /*#__PURE__*/_react.default.createElement(_ui.IconSave24, {
196
- color: !(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access = fileObject.access) !== null && _fileObject$access !== void 0 && _fileObject$access.update ? iconActiveColor : iconInactiveColor
196
+ color: !onSave || !(!(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access = fileObject.access) !== null && _fileObject$access !== void 0 && _fileObject$access.update) ? iconInactiveColor : iconActiveColor
197
197
  }),
198
- disabled: !(!(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access2 = fileObject.access) !== null && _fileObject$access2 !== void 0 && _fileObject$access2.update),
198
+ disabled: !onSave || !(!(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access2 = fileObject.access) !== null && _fileObject$access2 !== void 0 && _fileObject$access2.update),
199
199
  onClick: fileObject !== null && fileObject !== void 0 && fileObject.id ? () => {
200
200
  toggleMenu();
201
201
  onSave();
@@ -260,7 +260,6 @@ FileMenu.defaultProps = {
260
260
  onNew: Function.prototype,
261
261
  onOpen: Function.prototype,
262
262
  onRename: Function.prototype,
263
- onSave: Function.prototype,
264
263
  onSaveAs: Function.prototype,
265
264
  onTranslate: Function.prototype
266
265
  };
@@ -167,9 +167,9 @@ export const FileMenu = ({
167
167
  }), /*#__PURE__*/React.createElement(MenuItem, {
168
168
  label: fileObject !== null && fileObject !== void 0 && fileObject.id ? i18n.t('Save') : i18n.t('Save…'),
169
169
  icon: /*#__PURE__*/React.createElement(IconSave24, {
170
- color: !(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access = fileObject.access) !== null && _fileObject$access !== void 0 && _fileObject$access.update ? iconActiveColor : iconInactiveColor
170
+ color: !onSave || !(!(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access = fileObject.access) !== null && _fileObject$access !== void 0 && _fileObject$access.update) ? iconInactiveColor : iconActiveColor
171
171
  }),
172
- disabled: !(!(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access2 = fileObject.access) !== null && _fileObject$access2 !== void 0 && _fileObject$access2.update),
172
+ disabled: !onSave || !(!(fileObject !== null && fileObject !== void 0 && fileObject.id) || fileObject !== null && fileObject !== void 0 && (_fileObject$access2 = fileObject.access) !== null && _fileObject$access2 !== void 0 && _fileObject$access2.update),
173
173
  onClick: fileObject !== null && fileObject !== void 0 && fileObject.id ? () => {
174
174
  toggleMenu();
175
175
  onSave();
@@ -232,7 +232,6 @@ FileMenu.defaultProps = {
232
232
  onNew: Function.prototype,
233
233
  onOpen: Function.prototype,
234
234
  onRename: Function.prototype,
235
- onSave: Function.prototype,
236
235
  onSaveAs: Function.prototype,
237
236
  onTranslate: Function.prototype
238
237
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "21.9.1",
3
+ "version": "21.10.0",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {