diff --git a/src/App.svelte b/src/App.svelte index 13f9d517..c5548087 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -49,6 +49,7 @@ import UserDetail from "./components/UserDetail.svelte"; OpenAPI.BASE = config.baseurl; import { register as registerSW } from "./swmodule"; + import TeamDetail from "./components/TeamDetail.svelte"; store.init(); // registerSW(); @@ -85,8 +86,13 @@ - - + + + + + + + diff --git a/src/components/AddTeamModal.svelte b/src/components/AddTeamModal.svelte new file mode 100644 index 00000000..68f54be0 --- /dev/null +++ b/src/components/AddTeamModal.svelte @@ -0,0 +1,181 @@ + + +{#if modal_open} +
{ + modal_open = false; + }}> +
+ +
+{/if} diff --git a/src/components/TeamDetail.svelte b/src/components/TeamDetail.svelte new file mode 100644 index 00000000..7ae6fe8f --- /dev/null +++ b/src/components/TeamDetail.svelte @@ -0,0 +1,210 @@ + + +{#if data_loaded} +
+
+ {original.name} + + {#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:DELETE')} + {#if delete_triggered} + + + {/if} + {#if !delete_triggered} + + {/if} + {/if} + {#if !delete_triggered} + + {/if} + +
+
+
+ +
+
+
+ + +
+
+ + +
+ +
+{:else} + {#await promise} + team detail is being loaded... + {:catch error} + + {/await} +{/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..05b4936e --- /dev/null +++ b/src/components/TeamsEmptyState.svelte @@ -0,0 +1,15 @@ + + +
+

+ 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..d8400b8d --- /dev/null +++ b/src/components/TeamsOverview.svelte @@ -0,0 +1,160 @@ + + +{#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:GET')} + {#await teams_promise} + + {:then} + {#if current_teams.length === 0} + + {:else} + +
+ + + + + + + + + + + {#each current_teams as t} + {#if Object.values(t) + .toString() + .toLowerCase() + .includes(searchvalue)} + + + + + {#if active_deletes[t.id] === true} + + {:else} + + {/if} + + {/if} + {/each} + +
+ Name + + {$_('organization')} + + Contact + + Action +
+
+
+
+ {t.name} +
+
+
+
+
+
+
+ {#if t.parentGroup} + {t.parentGroup.name} + {:else}no organization specified{/if} +
+
+
+
+
+
+
+ {#if t.contact} + {JSON.stringify(t.contact)} + {:else}no contact specified{/if} +
+
+
+
+ + + + Edit + {#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:DELETE')} + + {/if} +
+
+ {/if} + {:catch error} +
+ + {$_('general_promise_error')} + {error} + +
+ {/await} +{/if} diff --git a/src/components/UsersOverview.svelte b/src/components/UsersOverview.svelte index c6844137..28603c25 100644 --- a/src/components/UsersOverview.svelte +++ b/src/components/UsersOverview.svelte @@ -10,7 +10,6 @@ export let current_users=[]; $: advanced_search = false; usersstore.subscribe((val) => { - userscache = val; current_users=val; }); users_promise.then((data) => { diff --git a/src/locales/en.json b/src/locales/en.json index 6923ebd0..53fe708e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -40,6 +40,7 @@ "an_error_happened_while_fetching_the_data": "An error happened while fetching the data" }, "delete-organization": "Delete Organization", + "delete-team": "Delete Team", "delete-user": "Delete User", "dependency_name": "Name", "dont-have-your-email-connected": "Don't have your email connected?", @@ -94,6 +95,7 @@ "minimum-lap-time-in-s": "minimum lap time in s", "no-license-text-could-be-found": "No license text could be found 😢", "no-tracks-added-yet": "there are no tracks added yet.", + "organization": "Organization", "organizations": "Organizations", "orgs": "Orgs", "oss_credit_description": "We use a lot of open source software on these projects, and would like to thank the following projects and contributors who help make open source great!", @@ -111,6 +113,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",