feat: org and course student analytics page (#509)

* UI initialization

* feat: structure API

* feat: audience & people analytics

* feat: quick changes

* feat: add comments

* redesign course student page

* chore: make requests to db more efficient

* clean up analytics page for course

* feat: finish up audience analytics page

* chore: minor UI tweaks

* translate all

* replace inserts of log in events to update

* catch error if last_login isn't inserted

---------

Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
Adeyemi Adetunji
2024-12-30 02:59:10 +01:00
committed by GitHub
co-authored by Rotimi Best
parent 381776f388
commit f69bf920a9
46 changed files with 1916 additions and 437 deletions
@@ -1,7 +1,6 @@
<script lang="ts">
// import { Moon } from 'svelte-loading-spinners';
import { VARIANTS, VARIANTS_CLASS } from './constants';
import { Loading } from 'carbon-components-svelte';
import { VARIANTS, VARIANTS_CLASS } from './constants';
export let label = '';
export let className = '';
@@ -13,18 +12,22 @@
export let isDisabled = false;
export let isLoading = false;
export let disableScale = false;
$: loadingClass =
isLoading || isDisabled
? 'cursor-not-allowed opacity-25'
: `cursor-pointer ${!disableScale && 'hover:scale-95'}`;
$: cname = `flex items-center h-auto ${loadingClass} ${
VARIANTS_CLASS[isLoading ? VARIANTS.OUTLINED : variant]
} ${
!disablePadding && 'px-5 py-[0.2rem]'
} rounded-md min-h-[36px] w-fit justify-center sm:w-auto ${
variant !== VARIANTS.TEXT && 'hover:shadow-xl'
} transition-all delay-150 duration-300 ease-in-out`;
</script>
<button
class="{isLoading || isDisabled
? 'opacity-25 cursor-not-allowed'
: `cursor-pointer ${
!disableScale && 'hover:scale-95'
}`} flex items-center h-auto {VARIANTS_CLASS[
isLoading ? VARIANTS.OUTLINED : variant
]} {!disablePadding &&
'py-[0.5rem] px-6'} rounded-md {className} w-fit min-h-[36px] justify-center sm:w-auto {variant !==
VARIANTS.TEXT && 'hover:shadow-xl'} transition-all delay-150 duration-300 ease-in-out"
class={`${cname} ${className}`}
on:click={onClick}
{name}
{type}
@@ -32,7 +35,6 @@
>
{#if isLoading}
<Loading withOverlay={false} small class="mr-2" />
<!-- <Moon size="20" color="#1d4ed8" unit="px" duration="1s" /> -->
{/if}
{#if !!label}
{label}