diff --git a/src/components/AddOrgModal.svelte b/src/components/AddOrgModal.svelte new file mode 100644 index 00000000..bd7131bb --- /dev/null +++ b/src/components/AddOrgModal.svelte @@ -0,0 +1,162 @@ + + +{#if modal_open} +
{ + modal_open = false; + }}> +
+ +
+{/if} diff --git a/src/components/OrgDetail.svelte b/src/components/OrgDetail.svelte index fc3107eb..42b68879 100644 --- a/src/components/OrgDetail.svelte +++ b/src/components/OrgDetail.svelte @@ -1,83 +1,205 @@ -
- - Orgs - -

- configure the tracks & minimum lap times -

-
-
- +{#if data_loaded} +
+
+ {original.name} + + {#if store.state.jwtinfo.userdetails.permissions.includes('USER:DELETE')} + {#if delete_triggered} + + + {/if} + {#if !delete_triggered} + + {/if} + {/if} + {#if !delete_triggered} + + {/if} +
-
-
+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+ +{:else} + {#await promise} + organization detail is being loaded... + {:catch error} + + {/await} +{/if} diff --git a/src/components/OrgOverview.svelte b/src/components/OrgOverview.svelte new file mode 100644 index 00000000..f22ddb3a --- /dev/null +++ b/src/components/OrgOverview.svelte @@ -0,0 +1,157 @@ + + +{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:GET')} + {#await promise} + + {:then} + {#if current_organizations.length === 0} + + {:else} + +
+ + + + + + + + + + + {#each current_organizations as o} + {#if Object.values(o) + .toString() + .toLowerCase() + .includes(searchvalue)} + + + + + {#if active_deletes[o.id] === true} + + {:else} + + {/if} + + {/if} + {/each} + +
+ Name + + Address + + Contact + + Action +
+
+
+
+ {o.name} +
+
+
+
+
+
+
+ {#if o.address} + {JSON.stringify(o.address)} + {:else}no address specified{/if} +
+
+
+
+
+
+
+ {#if o.contact} + {JSON.stringify(o.contact)} + {:else}no contact specified{/if} +
+
+
+
+ + + + Edit + {#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:DELETE')} + + {/if} +
+
+ {/if} + {:catch error} +
+ + {$_('general_promise_error')} + {error} + +
+ {/await} +{/if} diff --git a/src/components/Orgs.svelte b/src/components/Orgs.svelte index 1ced1f5a..4571e8f4 100644 --- a/src/components/Orgs.svelte +++ b/src/components/Orgs.svelte @@ -1,13 +1,31 @@
- Orgs + {$_('organizations')} + {#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:CREATE')} + + {/if} -

- add, delete, edit organizations -

- +

manage runner organizations

+
+ +{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:CREATE')} + +{/if} diff --git a/src/components/OrgsEmptyState.svelte b/src/components/OrgsEmptyState.svelte new file mode 100644 index 00000000..5e927dc9 --- /dev/null +++ b/src/components/OrgsEmptyState.svelte @@ -0,0 +1,15 @@ + + +
+

+ There are no organizations added yet.
+ Add your first organization +

+
+ + diff --git a/src/locales/en.json b/src/locales/en.json index 0c3b7555..4138bb74 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,127 +1,132 @@ { - "404message": "Sorry, the page you are looking for could not be found.", - "404title": "Error 404", - "about": "About", - "action": "Action", - "add-your-first-track": "Add your first track", - "application_name": "Lauf fΓΌr Kaya! - Admin", - "author": "Author", - "browse": "Browse", - "by": "by", - "cancel": "Cancel", - "cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity", - "changelog": "Changelog", - "close": "Close", - "confirm-delete": "Confirm Delete", - "count_organizations": "# Organizations", - "count_teams": "# Teams", - "create": "Create", - "create-a-new-track": "Create a new Track", - "create-user": "Create User", - "credits": "Credits", - "dashboard-greeting": "hello there", - "dashboard-title": "Dashboard", - "datatable": { - "search": "πŸ” Search...", - "sort_column_ascending": "Sort column ascending", - "sort_column_descending": "Sort column descending", - "previous": "Previous", - "next": "Next", - "page": "Page", - "showing": "Showing", - "records": "Records", - "of": "of", - "to": "to", - "loading": "Loading...", - "no_matching_records_found": "No matching records found", - "an_error_happened_while_fetching_the_data": "An error happened while fetching the data" - }, - "delete-user": "Delete User", - "dependency_name": "Name", - "dont-have-your-email-connected": "Don't have your email connected?", - "dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌", - "drag-and-drop-your-files-or": "Drag & Drop your files or", - "e-mail-adress": "E-Mail Adress", - "email_address_or_username": "Email / username", - "error_on_login": "Error on login", - "faq": "FAQ", - "filepond__abort": "Abort", - "filepond__cancel": "Cancel", - "filepond__error-during-load": "Error during load", - "filepond__error-during-remove": "Error during remove", - "filepond__error-during-revert": "Error during revert", - "filepond__error-during-upload": "Error during upload", - "filepond__field-contains-invalid-files": "Field contains invalid files", - "filepond__loading": "Loading", - "filepond__remove": "Remove", - "filepond__retry": "Retry", - "filepond__size-not-available": "Size not available", - "filepond__tap-to-cancel": "tap to cancel", - "filepond__tap-to-retry": "tap to retry", - "filepond__tap-to-undo": "tap to undo", - "filepond__undo": "Undo", - "filepond__upload": "Upload", - "filepond__upload-cancelled": "Upload cancelled", - "filepond__upload-complete": "Upload complete", - "filepond__uploading": "Uploading", - "filepond__waiting-for-size": "Waiting for size", - "first-name": "First name", - "first-name-is-required": "First Name is required", - "forgot_password?": "Forgot your password?", - "general-stats": "General Stats", - "general_promise_error": "😒 Error", - "goback": "Go Home", - "groups": "Groups", - "hallo": "hello", - "installed-version": "Installed version", - "invalid-mail-reset": "the provided email is invalid", - "last-name": "Last name", - "last-name-is-required": "Last Name is required", - "lfk-is-os": "The \"Lauf fΓΌr Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.", - "license": "License", - "licenses-are-being-loaded": "Licenses are being loaded...", - "log_in": "Log in", - "log_in_to_your_account": "Log in to your account", - "login_is_checked": "Login is being checked...", - "logout": "Logout", - "mail-validation-in-progress": "mail validation in progress...", - "manage-admin-users": "manage admin users", - "middle-name": "Middle name", - "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.", - "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!", - "password": "Password", - "password-is-required": "Password is required", - "please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.", - "profile-picture": "Profile Picture", - "read-license": "Read License", - "register": "Register", - "repo_link": "Link", - "reset-my-password": "Reset my password", - "runners": "Runners", - "save-changes": "Save Changes", - "send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services", - "settings": "Settings", - "signout": "Sign out", - "stats-are-being-loaded": "stats are being loaded...", - "teams": "Teams", - "this-might-take-a-moment": "This might take a moment πŸ‘€", - "total-distance": "total distance", - "total-donations": "total donations", - "total-scans": "total scans", - "track-added": "Track added", - "track-data-is-being-loaded": "Track data is being loaded", - "track-is-being-added": "Track is being added...", - "track-length-in-m": "Track Length in m", - "track-name": "Track name", - "tracks": "Tracks", - "updating-user": "updating user...", - "user-updated": "User updated", - "username": "Username", - "users": "Users", - "valid-email-is-required": "valid email is required", - "welcome_wavinghand": "Welcome πŸ‘‹", - "your_profile": "Your Profile" -} \ No newline at end of file + "404message": "Sorry, the page you are looking for could not be found.", + "404title": "Error 404", + "about": "About", + "action": "Action", + "add-your-first-track": "Add your first track", + "application_name": "Lauf fΓΌr Kaya! - Admin", + "author": "Author", + "browse": "Browse", + "by": "by", + "cancel": "Cancel", + "cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity", + "changelog": "Changelog", + "close": "Close", + "confirm-delete": "Confirm Delete", + "count_organizations": "# Organizations", + "count_teams": "# Teams", + "create": "Create", + "create-a-new-track": "Create a new Track", + "create-user": "Create User", + "credits": "Credits", + "dashboard-greeting": "hello there", + "dashboard-title": "Dashboard", + "datatable": { + "search": "πŸ” Search...", + "sort_column_ascending": "Sort column ascending", + "sort_column_descending": "Sort column descending", + "previous": "Previous", + "next": "Next", + "page": "Page", + "showing": "Showing", + "records": "Records", + "of": "of", + "to": "to", + "loading": "Loading...", + "no_matching_records_found": "No matching records found", + "an_error_happened_while_fetching_the_data": "An error happened while fetching the data" + }, + "delete-user": "Delete User", + "dependency_name": "Name", + "dont-have-your-email-connected": "Don't have your email connected?", + "dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌", + "drag-and-drop-your-files-or": "Drag & Drop your files or", + "e-mail-adress": "E-Mail Adress", + "email_address_or_username": "Email / username", + "error_on_login": "Error on login", + "faq": "FAQ", + "filepond__abort": "Abort", + "filepond__cancel": "Cancel", + "filepond__error-during-load": "Error during load", + "filepond__error-during-remove": "Error during remove", + "filepond__error-during-revert": "Error during revert", + "filepond__error-during-upload": "Error during upload", + "filepond__field-contains-invalid-files": "Field contains invalid files", + "filepond__loading": "Loading", + "filepond__remove": "Remove", + "filepond__retry": "Retry", + "filepond__size-not-available": "Size not available", + "filepond__tap-to-cancel": "tap to cancel", + "filepond__tap-to-retry": "tap to retry", + "filepond__tap-to-undo": "tap to undo", + "filepond__undo": "Undo", + "filepond__upload": "Upload", + "filepond__upload-cancelled": "Upload cancelled", + "filepond__upload-complete": "Upload complete", + "filepond__uploading": "Uploading", + "filepond__waiting-for-size": "Waiting for size", + "first-name": "First name", + "first-name-is-required": "First Name is required", + "forgot_password?": "Forgot your password?", + "general-stats": "General Stats", + "general_promise_error": "😒 Error", + "goback": "Go Home", + "groups": "Groups", + "hallo": "hello", + "installed-version": "Installed version", + "invalid-mail-reset": "the provided email is invalid", + "last-name": "Last name", + "last-name-is-required": "Last Name is required", + "lfk-is-os": "The \"Lauf fΓΌr Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.", + "license": "License", + "licenses-are-being-loaded": "Licenses are being loaded...", + "log_in": "Log in", + "log_in_to_your_account": "Log in to your account", + "login_is_checked": "Login is being checked...", + "logout": "Logout", + "mail-validation-in-progress": "mail validation in progress...", + "manage-admin-users": "manage admin users", + "middle-name": "Middle name", + "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.", + "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!", + "password": "Password", + "password-is-required": "Password is required", + "please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.", + "profile-picture": "Profile Picture", + "read-license": "Read License", + "register": "Register", + "repo_link": "Link", + "reset-my-password": "Reset my password", + "runners": "Runners", + "save-changes": "Save Changes", + "send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services", + "settings": "Settings", + "signout": "Sign out", + "stats-are-being-loaded": "stats are being loaded...", + "teams": "Teams", + "this-might-take-a-moment": "This might take a moment πŸ‘€", + "total-distance": "total distance", + "total-donations": "total donations", + "total-scans": "total scans", + "track-added": "Track added", + "track-data-is-being-loaded": "Track data is being loaded", + "track-is-being-added": "Track is being added...", + "track-length-in-m": "Track Length in m", + "track-name": "Track name", + "tracks": "Tracks", + "updating-user": "updating user...", + "user-updated": "User updated", + "username": "Username", + "users": "Users", + "valid-email-is-required": "valid email is required", + "welcome_wavinghand": "Welcome πŸ‘‹", + "your_profile": "Your Profile", + "organizations": "Organizations", + "create-organization": "Create Organization", + "contact": "Contact", + "address": "Address", + "delete-organization": "Delete Organization" +}