diff --git a/dashboard/src/lib/group/List.svelte b/dashboard/src/lib/group/List.svelte deleted file mode 100644 index 1b16e6d5..00000000 --- a/dashboard/src/lib/group/List.svelte +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - -
- -
Search groups -
-
-
- - - - - Page length - - - - - - - - - - Search by - - - - - - - - - - - Sort by - - - - {#if !isPublic}{/if} - - - - - - - Sort order - - - - - - - {#if !isPublic} - - - Only show - - - - - - - - {/if} - - {#if !isPublic} -
- - - - memberSearchMode = "include"} on:keyup={e => e.key === "Enter" ? memberSearchMode = "include" : ""} tabindex={0}>{@html memberSearchMode === "include" ? "include" : "include"} - | memberSearchMode = "exclude"} on:keyup={e => e.key === "Enter" ? memberSearchMode = "exclude" : ""} tabindex={0}>{@html memberSearchMode === "exclude" ? "exclude" : "exclude"} - | memberSearchMode = "match"} on:keyup={e => e.key === "Enter" ? memberSearchMode = "match" : ""} tabindex={0}>{@html memberSearchMode === "match" ? "exact match" : "exact match"} - | memberSearchMode = "none"} on:keyup={e => e.key === "Enter" ? memberSearchMode = "none" : ""} tabindex={0}>{@html memberSearchMode === "none" ? "none" : "none"} - Includes every group with any of the members. - Excludes every group with any of the members, opposite of include. - Only includes groups which have all the members selected. - Only includes groups that have no members. - {/if} -
-
- - -{#if listLoading && !err} -
- -
-{:else if err} - - - {err} - - - - - -{:else} - - - - - - - - - - -{#if !isPublic} - -{/if} -{#if settings && settings.accessibility ? (!settings.accessibility.expandedcards && !settings.accessibility.pagelinks) : true} - - {#each slicedList as group, index (group.id)} - {#if (!isPublic && group.privacy.visibility === "public") || isPublic} - - - - - - - {:else} - - - - - - - {/if} - {/each} - -{:else if settings.accessibility.expandedcards} - {#each slicedList as group, index (group.id)} - {#if (!isPublic && group.privacy.visibility === "public") || isPublic} - - - - - - - - - - - {:else} - - - - - - - - - - - {/if} - {/each} -{:else} -
- {#each slicedList as group, index (group.id)} - {#if (!isPublic && group.privacy.visibility === "public") || isPublic} - - - - - - - - {:else} - - - - - - - - {/if} - {/each} -
-{/if} - -{/if} \ No newline at end of file diff --git a/dashboard/src/lib/list/List.svelte b/dashboard/src/lib/list/List.svelte new file mode 100644 index 00000000..111073cf --- /dev/null +++ b/dashboard/src/lib/list/List.svelte @@ -0,0 +1,232 @@ + + + + +{#if listLoading && !err} +
+ +
+{:else if err} + + + {err} + + + + + +{:else} + + + +{/if} + +{#if !err && !isPublic} + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} +{/if} + +{#if !listLoading && !err} +{#if settings && settings.accessibility ? (!settings.accessibility.expandedcards && !settings.accessibility.pagelinks) : true} + + {#each slicedList as item, index} + + +
+ {#if isPublic || item.privacy.visibility === "public"} + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} + {:else} + + {/if} +
+
+ {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} +
+ {/each} +
+{:else if settings.accessibility.expandedcards} + {#each slicedList as item, index} + + + +
+ {#if isPublic || item.privacy.visibility === "public"} + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} + {:else} + + {/if} +
+
+
+ + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} + +
+ {/each} +{:else} +
+ {#each slicedList as item, index} + + + +
+ {#if isPublic || item.privacy.visibility === "public"} + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} + {:else} + + {/if} +
+
+ +
+ {/each} +
+{/if} + +{/if} \ No newline at end of file diff --git a/dashboard/src/lib/list/ListControl.svelte b/dashboard/src/lib/list/ListControl.svelte new file mode 100644 index 00000000..626b4e74 --- /dev/null +++ b/dashboard/src/lib/list/ListControl.svelte @@ -0,0 +1,233 @@ + + + + + + +
+ +
Search {itemType === "member" ? "members" : "groups"} +
+
+
+ + + + + Page length + + + + + + + + + + Search by + + + + + + + + + + + Sort by + + + + {#if !isPublic}{/if} + + + + + + + Sort order + + + + + + + {#if !isPublic} + + + Only show + + + + + + + + {/if} + + {#if !isPublic} +
+ + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} + + groupSearchMode = "include"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "include" : ""} tabindex={0}>{@html groupSearchMode === "include" ? "include" : "include"} + | groupSearchMode = "exclude"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "exclude" : ""} tabindex={0}>{@html groupSearchMode === "exclude" ? "exclude" : "exclude"} + | groupSearchMode = "match"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "match" : ""} tabindex={0}>{@html groupSearchMode === "match" ? "exact match" : "exact match"} + | groupSearchMode = "none"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "none" : ""} tabindex={0}>{@html groupSearchMode === "none" ? "none" : "none"} + Includes every member who's a part of any of the groups. + Excludes every member who's a part of any of the groups, the opposite of include. + Only includes members who are a part of every group. + Only includes members that are in no groups. + {/if} +
+
\ No newline at end of file diff --git a/dashboard/src/lib/list/ListSearch.svelte b/dashboard/src/lib/list/ListSearch.svelte new file mode 100644 index 00000000..8b8e7562 --- /dev/null +++ b/dashboard/src/lib/list/ListSearch.svelte @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dashboard/src/lib/member/List.svelte b/dashboard/src/lib/member/List.svelte deleted file mode 100644 index 33efa25a..00000000 --- a/dashboard/src/lib/member/List.svelte +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - -
- -
Search members -
-
-
- - - - - Page length - - - - - - - - - - Search by - - - - - - - - - - - Sort by - - - - {#if !isPublic}{/if} - - - - - - - Sort order - - - - - - - {#if !isPublic} - - - Only show - - - - - - - - {/if} - - {#if !isPublic} -
- - - - groupSearchMode = "include"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "include" : ""} tabindex={0}>{@html groupSearchMode === "include" ? "include" : "include"} - | groupSearchMode = "exclude"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "exclude" : ""} tabindex={0}>{@html groupSearchMode === "exclude" ? "exclude" : "exclude"} - | groupSearchMode = "match"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "match" : ""} tabindex={0}>{@html groupSearchMode === "match" ? "exact match" : "exact match"} - | groupSearchMode = "none"} on:keyup={e => e.key === "Enter" ? groupSearchMode = "none" : ""} tabindex={0}>{@html groupSearchMode === "none" ? "none" : "none"} - Includes every member who's a part of any of the groups. - Excludes every member who's a part of any of the groups, the opposite of include. - Only includes members who are a part of every group. - Only includes members that are in no groups. - {/if} -
-
- - -{#if listLoading && !err} -
- -
-{:else if err} - - - {err} - - - - - -{:else} - - - - - - - - - - -{#if !isPublic} - -{/if} -{#if settings && settings.accessibility ? (!settings.accessibility.expandedcards && !settings.accessibility.pagelinks) : true} - - {#each slicedList as member, index (member.id)} - {#if (!isPublic && member.privacy.visibility === "public") || isPublic} - - - - - - - {:else} - - - - - - - {/if} - {/each} - -{:else if settings.accessibility.expandedcards} - {#each slicedList as member, index (member.id)} - {#if (!isPublic && member.privacy.visibility === "public") || isPublic} - - - - - - - - - - - {:else} - - - - - - - - - - - {/if} - {/each} -{:else} -
- {#each slicedList as member, index (member.id)} - {#if (!isPublic && member.privacy.visibility === "public") || isPublic} - - - - - - - - {:else} - - - - - - - - {/if} - {/each} -
-{/if} - -{/if} \ No newline at end of file diff --git a/dashboard/src/pages/Dash.svelte b/dashboard/src/pages/Dash.svelte index dec5190b..cbf09b83 100644 --- a/dashboard/src/pages/Dash.svelte +++ b/dashboard/src/pages/Dash.svelte @@ -4,14 +4,11 @@ import { currentUser, loggedIn } from '../stores'; import SystemMain from '../lib/system/Main.svelte'; - import MemberList from '../lib/member/List.svelte'; - import GroupList from '../lib/group/List.svelte'; + import List from '../lib/list/List.svelte'; import { System } from '../api/types'; import api from '../api'; - let isPublic = false; - // get the state from the navigator so that we know which tab to start on let location = useLocation(); let params = $location.search && new URLSearchParams($location.search); @@ -82,13 +79,13 @@

Viewing your own system

- + - + - + diff --git a/dashboard/src/pages/profiles/Main.svelte b/dashboard/src/pages/profiles/Main.svelte index c394c2b9..d6e48f48 100644 --- a/dashboard/src/pages/profiles/Main.svelte +++ b/dashboard/src/pages/profiles/Main.svelte @@ -4,8 +4,7 @@ import { onMount } from 'svelte'; import SystemMain from '../../lib/system/Main.svelte'; - import MemberList from '../../lib/member/List.svelte'; - import GroupList from '../../lib/group/List.svelte'; + import List from '../../lib/list/List.svelte'; import { System } from '../../api/types'; import api from '../../api'; @@ -72,10 +71,10 @@ - + - + {/if}