1
0
Fork 0
mirror of synced 2024-07-02 13:01:09 +12:00

Fix stale data showing when creating user groups and reduce height of group rows

This commit is contained in:
Andrew Kingston 2022-08-01 11:56:01 +01:00
parent f13f8eec3b
commit 046f61e015

View file

@ -14,13 +14,9 @@
import { Constants } from "@budibase/frontend-core"
import CreateEditGroupModal from "./_components/CreateEditGroupModal.svelte"
import UserGroupsRow from "./_components/UserGroupsRow.svelte"
import { cloneDeep } from "lodash/fp"
$: hasGroupsLicense = $auth.user?.license.features.includes(
Constants.Features.USER_GROUPS
)
let modal
let group = {
const DefaultGroup = {
name: "",
icon: "UserGroup",
color: "var(--spectrum-global-color-blue-600)",
@ -28,6 +24,12 @@
apps: [],
roles: {},
}
let modal
let group = cloneDeep(DefaultGroup)
$: hasGroupsLicense = $auth.user?.license.features.includes(
Constants.Features.USER_GROUPS
)
async function deleteGroup(group) {
try {
@ -45,6 +47,11 @@
}
}
const showCreateGroupModal = () => {
group = cloneDeep(DefaultGroup)
modal?.show()
}
onMount(async () => {
try {
if (hasGroupsLicense) {
@ -78,10 +85,11 @@
icon={hasGroupsLicense ? "UserGroup" : ""}
cta={hasGroupsLicense}
on:click={hasGroupsLicense
? () => modal.show()
? showCreateGroupModal
: window.open("https://budibase.com/pricing/", "_blank")}
>{hasGroupsLicense ? "Create user group" : "Upgrade Account"}</Button
>
{hasGroupsLicense ? "Create user group" : "Upgrade Account"}
</Button>
{#if !hasGroupsLicense}
<Button
newStyles
@ -130,7 +138,7 @@
.groupTable :global(> div) {
background: var(--bg-color);
height: 70px;
height: 55px;
display: grid;
align-items: center;
grid-gap: var(--spacing-xl);