Merge branch 'develop' into BUDI-7189/type_search

This commit is contained in:
Andrew Kingston 2023-08-04 11:48:06 +01:00 committed by GitHub
commit fcbeaedf55
2 changed files with 15 additions and 16 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.8.29-alpha.16",
"version": "2.8.29-alpha.17",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -28,25 +28,13 @@
let userInfoModal
let changePasswordModal
onMount(async () => {
try {
await organisation.init()
await apps.load()
await groups.actions.init()
} catch (error) {
notifications.error("Error loading apps")
}
loaded = true
})
const publishedAppsOnly = app => app.status === AppStatus.DEPLOYED
$: userGroups = $groups.filter(group =>
group.users.find(user => user._id === $auth.user?._id)
)
$: publishedApps = $apps.filter(publishedAppsOnly)
$: userApps = getUserApps($auth.user)
$: publishedApps = $apps.filter(app => app.status === AppStatus.DEPLOYED)
$: userApps = getUserApps(publishedApps, userGroups, $auth.user)
function getUserApps(user) {
function getUserApps(publishedApps, userGroups, user) {
if (sdk.users.isAdmin(user)) {
return publishedApps
}
@ -84,6 +72,17 @@
// Swallow error and do nothing
}
}
onMount(async () => {
try {
await organisation.init()
await apps.load()
await groups.actions.init()
} catch (error) {
notifications.error("Error loading apps")
}
loaded = true
})
</script>
{#if $auth.user && loaded}