Feedback updates
This commit is contained in:
parent
42e6ff6608
commit
20885a708d
|
@ -28,10 +28,6 @@
|
||||||
let inviting = false
|
let inviting = false
|
||||||
let searchFocus = false
|
let searchFocus = false
|
||||||
|
|
||||||
// Initially filter entities without app access
|
|
||||||
// Show all when false
|
|
||||||
let filterByAppAccess = true
|
|
||||||
|
|
||||||
let appInvites = []
|
let appInvites = []
|
||||||
let filteredInvites = []
|
let filteredInvites = []
|
||||||
let filteredUsers = []
|
let filteredUsers = []
|
||||||
|
@ -62,7 +58,7 @@
|
||||||
appInvites = await getInvites()
|
appInvites = await getInvites()
|
||||||
|
|
||||||
//On Focus behaviour
|
//On Focus behaviour
|
||||||
if (!filterByAppAccess && (!query || query == "")) {
|
if (searchFocus && !query) {
|
||||||
filteredInvites =
|
filteredInvites =
|
||||||
appInvites.length > 100 ? appInvites.slice(0, 100) : [...appInvites]
|
appInvites.length > 100 ? appInvites.slice(0, 100) : [...appInvites]
|
||||||
return
|
return
|
||||||
|
@ -77,10 +73,7 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
$: filterByAppAccess, prodAppId, filterInvites(query)
|
$: searchFocus, prodAppId, filterInvites(query)
|
||||||
$: if (searchFocus === true) {
|
|
||||||
filterByAppAccess = false
|
|
||||||
}
|
|
||||||
|
|
||||||
const usersFetch = fetchData({
|
const usersFetch = fetchData({
|
||||||
API,
|
API,
|
||||||
|
@ -99,9 +92,9 @@
|
||||||
}
|
}
|
||||||
await usersFetch.update({
|
await usersFetch.update({
|
||||||
query: {
|
query: {
|
||||||
appId: query || !filterByAppAccess ? null : prodAppId,
|
appId: query || searchFocus ? null : prodAppId,
|
||||||
email: query,
|
email: query,
|
||||||
paginated: query || !filterByAppAccess ? null : false,
|
paginated: query || searchFocus ? null : false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
await usersFetch.refresh()
|
await usersFetch.refresh()
|
||||||
|
@ -127,12 +120,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const debouncedUpdateFetch = Utils.debounce(searchUsers, 250)
|
const debouncedUpdateFetch = Utils.debounce(searchUsers, 250)
|
||||||
$: debouncedUpdateFetch(
|
$: debouncedUpdateFetch(query, $store.builderSidePanel, loaded, searchFocus)
|
||||||
query,
|
|
||||||
$store.builderSidePanel,
|
|
||||||
loaded,
|
|
||||||
filterByAppAccess
|
|
||||||
)
|
|
||||||
|
|
||||||
const updateAppUser = async (user, role) => {
|
const updateAppUser = async (user, role) => {
|
||||||
if (!prodAppId) {
|
if (!prodAppId) {
|
||||||
|
@ -208,7 +196,7 @@
|
||||||
|
|
||||||
const searchGroups = (userGroups, query) => {
|
const searchGroups = (userGroups, query) => {
|
||||||
let filterGroups =
|
let filterGroups =
|
||||||
query?.length || !filterByAppAccess
|
query?.length || searchFocus
|
||||||
? userGroups
|
? userGroups
|
||||||
: getAppGroups(userGroups, prodAppId)
|
: getAppGroups(userGroups, prodAppId)
|
||||||
return filterGroups
|
return filterGroups
|
||||||
|
@ -240,7 +228,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds the 'role' attribute and sets it to the current app.
|
// Adds the 'role' attribute and sets it to the current app.
|
||||||
$: enrichedGroups = getEnrichedGroups($groups, filterByAppAccess)
|
$: enrichedGroups = getEnrichedGroups($groups, searchFocus)
|
||||||
$: filteredGroups = searchGroups(enrichedGroups, query)
|
$: filteredGroups = searchGroups(enrichedGroups, query)
|
||||||
$: groupUsers = buildGroupUsers(filteredGroups, filteredUsers)
|
$: groupUsers = buildGroupUsers(filteredGroups, filteredUsers)
|
||||||
$: allUsers = [...filteredUsers, ...groupUsers]
|
$: allUsers = [...filteredUsers, ...groupUsers]
|
||||||
|
@ -252,7 +240,7 @@
|
||||||
specific roles for the app.
|
specific roles for the app.
|
||||||
*/
|
*/
|
||||||
const buildGroupUsers = (userGroups, filteredUsers) => {
|
const buildGroupUsers = (userGroups, filteredUsers) => {
|
||||||
if (query || !filterByAppAccess) {
|
if (query || searchFocus) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
// Must exclude users who have explicit privileges
|
// Must exclude users who have explicit privileges
|
||||||
|
@ -452,20 +440,19 @@
|
||||||
|
|
||||||
<span
|
<span
|
||||||
class="search-input-icon"
|
class="search-input-icon"
|
||||||
class:searching={query || !filterByAppAccess}
|
class:searching={query || searchFocus}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
if (!filterByAppAccess) {
|
if (searchFocus) {
|
||||||
filterByAppAccess = true
|
searchFocus = false
|
||||||
}
|
}
|
||||||
if (!query) {
|
if (!query) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
query = null
|
query = null
|
||||||
userOnboardResponse = null
|
userOnboardResponse = null
|
||||||
filterByAppAccess = true
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon name={!filterByAppAccess || query ? "Close" : "Search"} />
|
<Icon name={searchFocus || query ? "Close" : "Search"} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -509,8 +496,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="auth-entity-access">
|
<div class="auth-entity-access">
|
||||||
<!-- {#key filteredInvites} -->
|
|
||||||
<!-- {invite.info.apps?.[prodAppId]} -->
|
|
||||||
<RoleSelect
|
<RoleSelect
|
||||||
placeholder={false}
|
placeholder={false}
|
||||||
value={invite.info.apps?.[prodAppId]}
|
value={invite.info.apps?.[prodAppId]}
|
||||||
|
@ -526,7 +511,6 @@
|
||||||
autoWidth
|
autoWidth
|
||||||
align="right"
|
align="right"
|
||||||
/>
|
/>
|
||||||
<!-- {/key} -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
Loading…
Reference in New Issue