@dhis2/analytics 23.5.2 → 23.6.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
+ # [23.6.0](https://github.com/dhis2/analytics/compare/v23.5.2...v23.6.0) (2022-03-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * disable Save button when onSave not passed (TECH-1013) ([#1167](https://github.com/dhis2/analytics/issues/1167)) ([fa87c8b](https://github.com/dhis2/analytics/commit/fa87c8b9ef3fe8e237e7d21423c81daf0ff6c817))
7
+
1
8
  ## [23.5.2](https://github.com/dhis2/analytics/compare/v23.5.1...v23.5.2) (2022-02-28)
2
9
 
3
10
 
@@ -196,9 +196,9 @@ const FileMenu = ({
196
196
  }), /*#__PURE__*/_react.default.createElement(_ui.MenuItem, {
197
197
  label: fileObject !== null && fileObject !== void 0 && fileObject.id ? _index.default.t('Save') : _index.default.t('Save…'),
198
198
  icon: /*#__PURE__*/_react.default.createElement(_ui.IconSave24, {
199
- 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
199
+ 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
200
200
  }),
201
- 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),
201
+ 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),
202
202
  onClick: fileObject !== null && fileObject !== void 0 && fileObject.id ? () => {
203
203
  toggleMenu();
204
204
  onSave();
@@ -263,7 +263,6 @@ FileMenu.defaultProps = {
263
263
  onNew: Function.prototype,
264
264
  onOpen: Function.prototype,
265
265
  onRename: Function.prototype,
266
- onSave: Function.prototype,
267
266
  onSaveAs: Function.prototype,
268
267
  onTranslate: Function.prototype
269
268
  };
@@ -170,9 +170,9 @@ export const FileMenu = ({
170
170
  }), /*#__PURE__*/React.createElement(MenuItem, {
171
171
  label: fileObject !== null && fileObject !== void 0 && fileObject.id ? i18n.t('Save') : i18n.t('Save…'),
172
172
  icon: /*#__PURE__*/React.createElement(IconSave24, {
173
- 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
173
+ 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
174
174
  }),
175
- 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),
175
+ 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),
176
176
  onClick: fileObject !== null && fileObject !== void 0 && fileObject.id ? () => {
177
177
  toggleMenu();
178
178
  onSave();
@@ -235,7 +235,6 @@ FileMenu.defaultProps = {
235
235
  onNew: Function.prototype,
236
236
  onOpen: Function.prototype,
237
237
  onRename: Function.prototype,
238
- onSave: Function.prototype,
239
238
  onSaveAs: Function.prototype,
240
239
  onTranslate: Function.prototype
241
240
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "23.5.2",
3
+ "version": "23.6.0",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {