Merge pull request #2107 from Budibase/fix/group-tag

Add dedicated renderer for roles tags
This commit is contained in:
Rory Powell 2021-07-26 08:33:10 +01:00 committed by GitHub
commit b05f134941
3 changed files with 13 additions and 4 deletions

View File

@ -19,7 +19,8 @@
import { fetchData } from "helpers"
import { users, auth } from "stores/portal"
import TagsRenderer from "./_components/TagsTableRenderer.svelte"
import TagsRenderer from "./_components/RolesTagsTableRenderer.svelte"
import UpdateRolesModal from "./_components/UpdateRolesModal.svelte"
import ForceResetPasswordModal from "./_components/ForceResetPasswordModal.svelte"

View File

@ -0,0 +1,8 @@
<script>
import TagsTableRenderer from "./TagsTableRenderer.svelte"
export let value
$: roles = value?.filter(role => role != null).map(role => role.name) ?? []
</script>
<TagsTableRenderer value={roles} />

View File

@ -4,9 +4,9 @@
const displayLimit = 5
$: roles = value?.filter(role => role != null).map(role => role.name) ?? []
$: tags = roles.slice(0, displayLimit)
$: leftover = roles.length - tags.length
$: values = value?.filter(value => value != null) ?? []
$: tags = values.slice(0, displayLimit)
$: leftover = values.length - tags.length
</script>
<div class="tag-renderer">