Renaming function to more accurately reflect its group app ID lookup purpose.

This commit is contained in:
mike12345567 2022-09-22 13:57:44 +01:00
parent 25b8f0ca3b
commit 31208b1f8f
5 changed files with 8 additions and 6 deletions

View File

@ -53,7 +53,7 @@
: publishedApps.filter(app => { : publishedApps.filter(app => {
return userGroups.find(group => { return userGroups.find(group => {
return groups.actions return groups.actions
.getGroupApps(group) .getGroupAppIds(group)
.map(role => apps.extractAppId(role)) .map(role => apps.extractAppId(role))
.includes(app.appId) .includes(app.appId)
}) })

View File

@ -42,7 +42,7 @@
$: group = $groups.find(x => x._id === groupId) $: group = $groups.find(x => x._id === groupId)
$: filtered = $users.data $: filtered = $users.data
$: groupApps = $apps.filter(app => $: groupApps = $apps.filter(app =>
groups.actions.getGroupApps(group).includes(app.appId) groups.actions.getGroupAppIds(group).includes(app.appId)
) )
$: { $: {
if (loaded && !group?._id) { if (loaded && !group?._id) {

View File

@ -44,7 +44,7 @@
if (!group.roles) { if (!group.roles) {
return false return false
} }
return groups.actions.getGroupApps(group).includes(fixedAppId) return groups.actions.getGroupAppIds(group).includes(fixedAppId)
}) })
async function removeUser(user) { async function removeUser(user) {
@ -114,7 +114,9 @@
autoWidth autoWidth
quiet quiet
value={group.roles[ value={group.roles[
groups.actions.getGroupApps(group).find(x => x === fixedAppId) groups.actions
.getGroupAppIds(group)
.find(x => x === fixedAppId)
]} ]}
allowPublic={false} allowPublic={false}
/> />

View File

@ -113,7 +113,7 @@
search = search?.toLowerCase() search = search?.toLowerCase()
return (allGroups || []).filter(group => { return (allGroups || []).filter(group => {
// Filter out assigned groups // Filter out assigned groups
const appIds = groups.actions.getGroupApps(group) const appIds = groups.actions.getGroupAppIds(group)
if (appIds.includes(appId)) { if (appIds.includes(appId)) {
return false return false
} }

View File

@ -77,7 +77,7 @@ export function createGroupsStore() {
await getGroup(groupId) await getGroup(groupId)
}, },
getGroupApps: group => { getGroupAppIds: group => {
return Object.keys(group?.roles || {}) return Object.keys(group?.roles || {})
}, },
} }