@dhis2/analytics 24.3.5 → 24.3.6

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
+ ## [24.3.6](https://github.com/dhis2/analytics/compare/v24.3.5...v24.3.6) (2022-11-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **OpenFileDialog:** use case insensitive sorting on displayName (DHIS2-13554) ([#1384](https://github.com/dhis2/analytics/issues/1384)) ([e8348f7](https://github.com/dhis2/analytics/commit/e8348f7fe4b9a9d6349eddf9c86b11b5939564a2))
7
+
1
8
  ## [24.3.5](https://github.com/dhis2/analytics/compare/v24.3.4...v24.3.5) (2022-11-17)
2
9
 
3
10
 
@@ -171,7 +171,7 @@ const FileMenu = _ref => {
171
171
  onNew: onNew,
172
172
  currentUser: currentUser
173
173
  }), menuIsOpen && /*#__PURE__*/_react.default.createElement(_ui.Layer, {
174
- onClick: toggleMenu,
174
+ onBackdropClick: toggleMenu,
175
175
  position: "fixed",
176
176
  level: 2000,
177
177
  dataTest: "file-menu-toggle-layer"
@@ -47,7 +47,7 @@ const getQuery = type => ({
47
47
  params: _ref => {
48
48
  let {
49
49
  sortField = 'displayName',
50
- sortDirection = 'asc',
50
+ sortDirection = 'iasc',
51
51
  page = 1,
52
52
  filters
53
53
  } = _ref;
@@ -138,6 +138,13 @@ const OpenFileDialog = _ref2 => {
138
138
 
139
139
  return queryFilters;
140
140
  }, [currentUser, filters]);
141
+ const formatSortDirection = (0, _react.useCallback)(() => {
142
+ if (sortField === 'displayName' && sortDirection !== 'default') {
143
+ return "i".concat(sortDirection);
144
+ }
145
+
146
+ return sortDirection;
147
+ }, [sortField, sortDirection]);
141
148
  const {
142
149
  loading,
143
150
  error,
@@ -177,11 +184,11 @@ const OpenFileDialog = _ref2 => {
177
184
  refetch({
178
185
  page,
179
186
  sortField,
180
- sortDirection,
187
+ sortDirection: formatSortDirection(),
181
188
  filters: formatFilters()
182
189
  });
183
190
  }
184
- }, [open, page, sortField, sortDirection, filters, refetch, formatFilters]);
191
+ }, [open, page, sortField, filters, refetch, formatFilters, formatSortDirection]);
185
192
  const headers = [{
186
193
  field: 'displayName',
187
194
  label: _d2I18n.default.t('Name'),
@@ -145,7 +145,7 @@ export const FileMenu = _ref => {
145
145
  onNew: onNew,
146
146
  currentUser: currentUser
147
147
  }), menuIsOpen && /*#__PURE__*/React.createElement(Layer, {
148
- onClick: toggleMenu,
148
+ onBackdropClick: toggleMenu,
149
149
  position: "fixed",
150
150
  level: 2000,
151
151
  dataTest: "file-menu-toggle-layer"
@@ -20,7 +20,7 @@ const getQuery = type => ({
20
20
  params: _ref => {
21
21
  let {
22
22
  sortField = 'displayName',
23
- sortDirection = 'asc',
23
+ sortDirection = 'iasc',
24
24
  page = 1,
25
25
  filters
26
26
  } = _ref;
@@ -111,6 +111,13 @@ export const OpenFileDialog = _ref2 => {
111
111
 
112
112
  return queryFilters;
113
113
  }, [currentUser, filters]);
114
+ const formatSortDirection = useCallback(() => {
115
+ if (sortField === 'displayName' && sortDirection !== 'default') {
116
+ return "i".concat(sortDirection);
117
+ }
118
+
119
+ return sortDirection;
120
+ }, [sortField, sortDirection]);
114
121
  const {
115
122
  loading,
116
123
  error,
@@ -150,11 +157,11 @@ export const OpenFileDialog = _ref2 => {
150
157
  refetch({
151
158
  page,
152
159
  sortField,
153
- sortDirection,
160
+ sortDirection: formatSortDirection(),
154
161
  filters: formatFilters()
155
162
  });
156
163
  }
157
- }, [open, page, sortField, sortDirection, filters, refetch, formatFilters]);
164
+ }, [open, page, sortField, filters, refetch, formatFilters, formatSortDirection]);
158
165
  const headers = [{
159
166
  field: 'displayName',
160
167
  label: i18n.t('Name'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "24.3.5",
3
+ "version": "24.3.6",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {