@dhis2/analytics 23.13.5 → 23.13.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
|
+
## [23.13.6](https://github.com/dhis2/analytics/compare/v23.13.5...v23.13.6) (2022-08-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **AboutUnit:** read sharing info from sharing object in AO ([#1299](https://github.com/dhis2/analytics/issues/1299)) ([d73a34f](https://github.com/dhis2/analytics/commit/d73a34f8f4b5498c9106cab7fb6f2a373be073b6))
|
|
7
|
+
|
|
1
8
|
## [23.13.5](https://github.com/dhis2/analytics/compare/v23.13.4...v23.13.5) (2022-08-08)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -44,7 +44,7 @@ const getQueries = type => ({
|
|
|
44
44
|
return id;
|
|
45
45
|
},
|
|
46
46
|
params: {
|
|
47
|
-
fields: 'id,displayDescription,created,createdBy[displayName],lastUpdated,subscribed,
|
|
47
|
+
fields: 'id,displayDescription,created,createdBy[displayName],lastUpdated,subscribed,sharing'
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
dataStatistics: {
|
|
@@ -112,7 +112,7 @@ const AboutAOUnit = _ref3 => {
|
|
|
112
112
|
id
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
}, [type, id]);
|
|
115
|
+
}, [type, id, refetch]);
|
|
116
116
|
|
|
117
117
|
const getAccessLevelString = access => {
|
|
118
118
|
const re = new RegExp("(?<accessLevel>".concat(READ_AND_WRITE, "?)"));
|
|
@@ -131,15 +131,15 @@ const AboutAOUnit = _ref3 => {
|
|
|
131
131
|
const sharingTextParts = [];
|
|
132
132
|
const re = new RegExp("^".concat(READ_AND_WRITE, "?"));
|
|
133
133
|
|
|
134
|
-
if (re.test(ao.
|
|
134
|
+
if (re.test(ao.sharing.public)) {
|
|
135
135
|
sharingTextParts.push(_d2I18n.default.t('all users ({{accessLevel}})', {
|
|
136
|
-
accessLevel: getAccessLevelString(ao.
|
|
136
|
+
accessLevel: getAccessLevelString(ao.sharing.public)
|
|
137
137
|
}));
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
const userAccesses = ao.
|
|
141
|
-
const groupAccesses = ao.
|
|
142
|
-
userAccesses.concat(groupAccesses).forEach(accessRule => {
|
|
140
|
+
const userAccesses = ao.sharing.users;
|
|
141
|
+
const groupAccesses = ao.sharing.userGroups;
|
|
142
|
+
Object.values(userAccesses).concat(Object.values(groupAccesses)).forEach(accessRule => {
|
|
143
143
|
sharingTextParts.push(_d2I18n.default.t('{{userOrGroup}} ({{accessLevel}})', {
|
|
144
144
|
userOrGroup: accessRule.displayName,
|
|
145
145
|
accessLevel: getAccessLevelString(accessRule.access)
|
|
@@ -21,7 +21,7 @@ const getQueries = type => ({
|
|
|
21
21
|
return id;
|
|
22
22
|
},
|
|
23
23
|
params: {
|
|
24
|
-
fields: 'id,displayDescription,created,createdBy[displayName],lastUpdated,subscribed,
|
|
24
|
+
fields: 'id,displayDescription,created,createdBy[displayName],lastUpdated,subscribed,sharing'
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
dataStatistics: {
|
|
@@ -89,7 +89,7 @@ const AboutAOUnit = _ref3 => {
|
|
|
89
89
|
id
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
}, [type, id]);
|
|
92
|
+
}, [type, id, refetch]);
|
|
93
93
|
|
|
94
94
|
const getAccessLevelString = access => {
|
|
95
95
|
const re = new RegExp("(?<accessLevel>".concat(READ_AND_WRITE, "?)"));
|
|
@@ -108,15 +108,15 @@ const AboutAOUnit = _ref3 => {
|
|
|
108
108
|
const sharingTextParts = [];
|
|
109
109
|
const re = new RegExp("^".concat(READ_AND_WRITE, "?"));
|
|
110
110
|
|
|
111
|
-
if (re.test(ao.
|
|
111
|
+
if (re.test(ao.sharing.public)) {
|
|
112
112
|
sharingTextParts.push(i18n.t('all users ({{accessLevel}})', {
|
|
113
|
-
accessLevel: getAccessLevelString(ao.
|
|
113
|
+
accessLevel: getAccessLevelString(ao.sharing.public)
|
|
114
114
|
}));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
const userAccesses = ao.
|
|
118
|
-
const groupAccesses = ao.
|
|
119
|
-
userAccesses.concat(groupAccesses).forEach(accessRule => {
|
|
117
|
+
const userAccesses = ao.sharing.users;
|
|
118
|
+
const groupAccesses = ao.sharing.userGroups;
|
|
119
|
+
Object.values(userAccesses).concat(Object.values(groupAccesses)).forEach(accessRule => {
|
|
120
120
|
sharingTextParts.push(i18n.t('{{userOrGroup}} ({{accessLevel}})', {
|
|
121
121
|
userOrGroup: accessRule.displayName,
|
|
122
122
|
accessLevel: getAccessLevelString(accessRule.access)
|