From d87b879cc3d6c771a8a9932409e39068e1b2acdb Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 14 Jan 2021 19:10:36 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=83=E2=80=8D=E2=99=82=EF=B8=8F?= =?UTF-8?q?=F0=9F=8F=83=E2=80=8D=E2=99=82=EF=B8=8F=F0=9F=8F=83=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20basic=20UI=20components=20for=20team=20man?= =?UTF-8?q?agement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #14 --- src/components/AddTeamModal.svelte | 159 ++++++++++++++++++++++ src/components/Teams.svelte | 21 +++ src/components/TeamsEmptyState.svelte | 14 ++ src/components/TeamsOverview.svelte | 182 ++++++++++++++++++++++++++ src/locales/en.json | 1 + 5 files changed, 377 insertions(+) create mode 100644 src/components/AddTeamModal.svelte create mode 100644 src/components/TeamsEmptyState.svelte create mode 100644 src/components/TeamsOverview.svelte diff --git a/src/components/AddTeamModal.svelte b/src/components/AddTeamModal.svelte new file mode 100644 index 00000000..aeff59c8 --- /dev/null +++ b/src/components/AddTeamModal.svelte @@ -0,0 +1,159 @@ + + +{#if modal_open} +
{ + modal_open = false; + }}> +
+ +
+{/if} diff --git a/src/components/Teams.svelte b/src/components/Teams.svelte index 7bcfd325..75ad7411 100644 --- a/src/components/Teams.svelte +++ b/src/components/Teams.svelte @@ -1,10 +1,31 @@
{$_('teams')} + {#if store.state.jwtinfo.userdetails.permissions.includes('USER:CREATE')} + + {/if}

everything is more fun together 🏃‍♂️🏃‍♀️🏃‍♂️

+
+ +{#if store.state.jwtinfo.userdetails.permissions.includes('USER:CREATE')} + +{/if} diff --git a/src/components/TeamsEmptyState.svelte b/src/components/TeamsEmptyState.svelte new file mode 100644 index 00000000..9e306776 --- /dev/null +++ b/src/components/TeamsEmptyState.svelte @@ -0,0 +1,14 @@ + + +
+

+ There are no teams added yet.
+ Add your first team +

+
+ + diff --git a/src/components/TeamsOverview.svelte b/src/components/TeamsOverview.svelte new file mode 100644 index 00000000..7f7b25a5 --- /dev/null +++ b/src/components/TeamsOverview.svelte @@ -0,0 +1,182 @@ + + +{#if store.state.jwtinfo.userdetails.permissions.includes('USER:GET')} + {#await teams_promise} + + {:then} + {#if current_teams.length === 0} + + {:else} + + + + +
+ + + + + + + + + + + {#each current_teams as u} + {#if Object.values(u) + .toString() + .toLowerCase() + .includes(searchvalue)} + + + + + {#if active_deletes[u.id] === true} + + {:else} + + {/if} + + {/if} + {/each} + +
+ Name + + Status + + Groups + + Action +
+
+ {#if u.profilePic} +
+ +
+ {/if} +
+
+ {u.firstname} + {u.middlename || ''} + {u.lastname} +
+
+ {u.email || u.username} +
+
+
+
+ {#if u.enabled} + Active + {:else} + Inactive + {/if} + + {#each u.groups as g} + {g.name} + {/each} + + + + + Edit + {#if store.state.jwtinfo.userdetails.permissions.includes('USER:DELETE')} + + {/if} +
+
+ {/if} + {:catch error} +
+ + {$_('general_promise_error')} + {error} + +
+ {/await} +{/if} diff --git a/src/locales/en.json b/src/locales/en.json index 0c3b7555..91c60fda 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -106,6 +106,7 @@ "settings": "Settings", "signout": "Sign out", "stats-are-being-loaded": "stats are being loaded...", + "team-name": "Team name", "teams": "Teams", "this-might-take-a-moment": "This might take a moment 👀", "total-distance": "total distance",