CLASSROOMIO-T-11: Refactoring
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script context="module">
|
||||
import { fetchCourse } from '../../../utils/services/courses';
|
||||
|
||||
export async function preload({ params }) {
|
||||
export async function preload({ params = { id: '' } }) {
|
||||
return { courseId: params.id };
|
||||
}
|
||||
</script>
|
||||
@@ -11,20 +11,22 @@
|
||||
import CourseContainer from '../../../components/CourseContainer/index.svelte';
|
||||
|
||||
import PageNav from '../../../components/PageNav/index.svelte';
|
||||
import PrimaryButton from '../../../components/PrimaryButton/index.svelte';
|
||||
// import PrimaryButton from '../../../components/PrimaryButton/index.svelte';
|
||||
import PageBody from '../../../components/PageBody/index.svelte';
|
||||
import RoleBasedSecurity from '../../../components/RoleBasedSecurity/index.svelte';
|
||||
import { setCourse, course, group } from '../../../components/Course/store';
|
||||
import { setCourse, course } from '../../../components/Course/store';
|
||||
import IssueCertificateModal from '../../../components/Course/components/Ceritficate/IssueCertificateModal.svelte';
|
||||
// import DeleteConfirmation from '../../../components/Course/components/People/DeleteConfirmation.svelte';
|
||||
import Design from '../../../components/Course/components/Ceritficate/Design.svelte';
|
||||
import Reports from '../../../components/Course/components/Ceritficate/Reports.svelte';
|
||||
|
||||
import { issueCertificateModal } from '../../../components/Course/components/Ceritficate/store';
|
||||
import { Tabs, Tab, TabContent } from 'carbon-components-svelte';
|
||||
// import { issueCertificateModal } from '../../../components/Course/components/Ceritficate/store';
|
||||
import { Tabs, Tab } from 'carbon-components-svelte';
|
||||
import TabContent from 'carbon-components-svelte/src/Tabs/TabContent.svelte';
|
||||
|
||||
export let courseId: string = '';
|
||||
let isStudent = false;
|
||||
|
||||
onMount(async () => {
|
||||
if ($course.id) return;
|
||||
const { data } = await fetchCourse(courseId);
|
||||
@@ -33,18 +35,21 @@
|
||||
</script>
|
||||
|
||||
<IssueCertificateModal />
|
||||
|
||||
<CourseContainer bind:isStudent>
|
||||
<PageNav title="Certificates" disableSticky={true}>
|
||||
<slot:fragment slot="widget">
|
||||
<RoleBasedSecurity allowedRoles={[1, 2]}>
|
||||
<PrimaryButton
|
||||
<!-- Hide Functionality For V1 -->
|
||||
<!-- <PrimaryButton
|
||||
className="mr-2 rounded-md text-sm font-medium"
|
||||
label="Issue Cert"
|
||||
onClick={() => ($issueCertificateModal.open = true)}
|
||||
/>
|
||||
/> -->
|
||||
</RoleBasedSecurity>
|
||||
</slot:fragment>
|
||||
</PageNav>
|
||||
|
||||
<PageBody className="w-full mx-0" padding="px-0">
|
||||
<Tabs autoWidth class="border-b border-gray-200">
|
||||
<Tab label="Design" />
|
||||
@@ -61,6 +66,3 @@
|
||||
</Tabs>
|
||||
</PageBody>
|
||||
</CourseContainer>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user