Skip to content

Commit 5d601b3

Browse files
committed
fix: filter non image approval access users from userGroupDataStore
1 parent b564586 commit 5d601b3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.2.6-beta-9",
3+
"version": "0.2.6-beta-10",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Common.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ const getImageApprovalPolicyDetailsFromMaterialResult = (cdMaterialsResult): Ima
248248

249249
const validGroups = userApprovalConfig.userGroups.map((group) => group.identifier)
250250

251-
const usersList = Object.keys(imageApprovalUsersInfo).filter((user) => user !== DefaultUserKey.system)
251+
// Have moved from Object.keys(imageApprovalUsersInfo) to approvalUsers since backend is not filtering out the users without approval
252+
// TODO: This check should be on BE. Need to remove this once BE is updated
253+
const usersList = approvalUsers.filter((user) => user !== DefaultUserKey.system)
252254
const groupIdentifierToUsersMap = usersList.reduce(
253255
(acc, user) => {
254256
const userGroups = imageApprovalUsersInfo[user] || []
@@ -277,6 +279,7 @@ const getImageApprovalPolicyDetailsFromMaterialResult = (cdMaterialsResult): Ima
277279
(acc, user) => {
278280
acc[user] = {
279281
email: user,
282+
// As of now it will always be true, but UI has handled it in a way that can support false as well
280283
hasAccess: approvalUsersMap[user] ?? false,
281284
}
282285
return acc

0 commit comments

Comments
 (0)