Skip to content

Commit

Permalink
fix: undefined org name in student invite link + community error (#101)
Browse files Browse the repository at this point in the history
* fix: move org slot media query to postcss

* fix: remove slot css

* fix: remove unused vars

* fix: a ton of community improvements

* chore: ci/cd supabase
  • Loading branch information
rotimi-best committed Dec 13, 2023
1 parent 8214ffd commit aa2f7c5
Show file tree
Hide file tree
Showing 13 changed files with 337 additions and 119 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy-supabase-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy Supabase on Push

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
PROJECT_ID: tapaozmyjsuykgerrfkt

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- run: supabase link --project-ref $PROJECT_ID
- run: supabase db push
8 changes: 8 additions & 0 deletions apps/dashboard/src/app.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ code {
overflow-y: auto;
}

@media screen and (max-width: 457px) {
.org-slot {
min-width: 100%;
max-height: calc(100vh - 48px);
overflow-y: auto;
}
}

@tailwind components;

@tailwind utilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@
export let onDelete = () => {};
export let onCancel = () => {};
export let open = false;
export let isQuestion = false;
</script>

<Modal onClose={() => (open = false)} bind:open width="w-96" modalHeading="Delete comment">
<Modal
onClose={() => (open = false)}
bind:open
width="w-96"
modalHeading="Delete {isQuestion ? 'question' : 'comment'}"
>
<div>
<h1 class="dark:text-white text-lg">Are you sure you want to delete this comment?</h1>
<h1 class="dark:text-white text-lg">
Are you sure you want to delete this {isQuestion ? 'question' : 'comment'}?
</h1>

<div class="mt-5 flex items-center justify-between">
<PrimaryButton
Expand Down
14 changes: 7 additions & 7 deletions apps/dashboard/src/lib/components/Org/Community/index.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script>
<script lang="ts">
import { goto } from '$app/navigation';
import AddCommentIcon from 'carbon-icons-svelte/lib/AddComment.svelte';
import CommunityLoader from './Loader.svelte';
Expand All @@ -15,10 +15,9 @@
let isLoading = false;
let discussions = [];
async function fetchCommunityQuestions(orgId) {
async function fetchCommunityQuestions(orgId?: string) {
if (!orgId) return;
isLoading = true;
const { data, error } = await supabase
.from('community_question')
.select(
Expand All @@ -29,12 +28,13 @@
created_at,
slug,
comments:community_answer(count),
author:organizationmember!community_question_author_id_fkey!inner(
profile!inner(fullname)
author:profile(
fullname
)
`
)
.eq('organization_id', orgId);
.eq('organization_id', orgId)
.order('created_at', { ascending: false });
console.log('data', data);
console.log('error', error);
isLoading = false;
Expand All @@ -48,7 +48,7 @@
data?.map((discussion) => ({
title: discussion.title,
slug: discussion.slug,
author: discussion?.author?.profile?.fullname,
author: discussion?.author?.fullname,
comments: discussion.comments?.[0]?.count || 0,
votes: discussion.votes,
createdAt: calDateDiff(discussion.created_at)
Expand Down
12 changes: 1 addition & 11 deletions apps/dashboard/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
import OrgLandingPage from '$lib/components/Org/LandingPage/index.svelte';
import Snackbar from '$lib/components/Snackbar/index.svelte';
import Backdrop from '$lib/components/Backdrop/index.svelte';
import OrgSideBar from '$lib/components/Org/SideBar.svelte';
import LMSSideBar from '$lib/components/LMS/SideBar.svelte';
import Apps from '$lib/components/Apps/index.svelte';
import PlayQuiz from '$lib/components/Org/Quiz/Play/index.svelte';
import { course } from '$lib/components/Course/store';
import { isCoursesPage, isOrgPage, isLMSPage, isQuizPage } from '$lib/utils/functions/app';
import { isCoursesPage, isOrgPage, isLMSPage } from '$lib/utils/functions/app';
import showAppsSideBar from '$lib/utils/functions/showAppsSideBar';
import isPublicRoute from '$lib/utils/functions/routes/isPublicRoute';
import { user, profile } from '$lib/utils/store/user';
Expand All @@ -34,7 +32,6 @@
import { setTheme } from '$lib/utils/functions/theme';
import hideNavByRoute from '$lib/utils/functions/routes/hideNavByRoute';
import shouldRedirectOnAuth from '$lib/utils/functions/routes/shouldRedirectOnAuth';
import AddOrgModal from '$lib/components/Org/AddOrgModal/AddOrgModal.svelte';
import { identifyPosthogUser, initPosthog } from '$lib/utils/services/posthog';
import { initSentry, setSentryUser } from '$lib/utils/services/sentry';
Expand Down Expand Up @@ -412,11 +409,4 @@
row-gap: 12px;
}
}
@media screen and (max-width: 457px) {
.org-slot {
min-width: 100%;
max-height: calc(100vh - 48px);
overflow-y: auto;
}
}
</style>
3 changes: 1 addition & 2 deletions apps/dashboard/src/routes/lms/community/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
import { goto } from '$app/navigation';
import Community from '$lib/components/Org/Community/index.svelte';
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
import { currentOrgPath } from '$lib/utils/store/org';
function askCommunity() {
goto(`${$currentOrgPath}/community/ask`);
goto(`/lms/community/ask`);
}
</script>

Expand Down
Loading

2 comments on commit aa2f7c5

@vercel
Copy link

@vercel vercel bot commented on aa2f7c5 Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on aa2f7c5 Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

landingpage – ./apps/classroomio-com

landingpage-git-main-rotimi-best.vercel.app
classroomio-com.vercel.app
landingpage-rotimi-best.vercel.app

Please sign in to comment.