fix: course settings warning popup
This commit is contained in:
@@ -1,42 +1,41 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
import { env } from '$env/dynamic/public';
|
||||||
import {
|
import {
|
||||||
CodeSnippet,
|
CodeSnippet,
|
||||||
Grid,
|
|
||||||
Row,
|
|
||||||
Column,
|
Column,
|
||||||
Toggle,
|
Grid,
|
||||||
|
RadioButton,
|
||||||
RadioButtonGroup,
|
RadioButtonGroup,
|
||||||
RadioButton
|
Row,
|
||||||
|
Toggle
|
||||||
} from 'carbon-components-svelte';
|
} from 'carbon-components-svelte';
|
||||||
import { Restart, ArrowUpRight } from 'carbon-icons-svelte';
|
import { ArrowUpRight, Restart } from 'carbon-icons-svelte';
|
||||||
import { env } from '$env/dynamic/public';
|
|
||||||
|
|
||||||
import SectionTitle from '$lib/components/Org/SectionTitle.svelte';
|
|
||||||
import UnsavedChanges from '$lib/components/UnsavedChanges/index.svelte';
|
|
||||||
import TextField from '$lib/components/Form/TextField.svelte';
|
|
||||||
import TextArea from '$lib/components/Form/TextArea.svelte';
|
import TextArea from '$lib/components/Form/TextArea.svelte';
|
||||||
|
import TextField from '$lib/components/Form/TextField.svelte';
|
||||||
|
import SectionTitle from '$lib/components/Org/SectionTitle.svelte';
|
||||||
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
||||||
|
import UnsavedChanges from '$lib/components/UnsavedChanges/index.svelte';
|
||||||
import DragAndDrop from './DragAndDrop.svelte';
|
import DragAndDrop from './DragAndDrop.svelte';
|
||||||
|
|
||||||
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
|
|
||||||
import { settings } from './store';
|
|
||||||
import { course } from '$lib/components/Course/store';
|
import { course } from '$lib/components/Course/store';
|
||||||
import type { Course } from '$lib/utils/types';
|
|
||||||
import { updateCourse, deleteCourse } from '$lib/utils/services/courses';
|
|
||||||
import { currentOrgPath, isFreePlan } from '$lib/utils/store/org';
|
|
||||||
import { isObject } from '$lib/utils/functions/isObject';
|
|
||||||
import { lessons } from '../Lesson/store/lessons';
|
|
||||||
import { currentOrg, currentOrgDomain } from '$lib/utils/store/org';
|
|
||||||
import { snackbar } from '$lib/components/Snackbar/store';
|
|
||||||
import UploadWidget from '$lib/components/UploadWidget/index.svelte';
|
|
||||||
import { handleOpenWidget } from '$lib/components/CourseLandingPage/store';
|
import { handleOpenWidget } from '$lib/components/CourseLandingPage/store';
|
||||||
import UpgradeBanner from '$lib/components/Upgrade/Banner.svelte';
|
|
||||||
import IconButton from '$lib/components/IconButton/index.svelte';
|
import IconButton from '$lib/components/IconButton/index.svelte';
|
||||||
import generateSlug from '$lib/utils/functions/generateSlug';
|
|
||||||
import { t } from '$lib/utils/functions/translations';
|
|
||||||
import DeleteModal from '$lib/components/Modal/DeleteModal.svelte';
|
import DeleteModal from '$lib/components/Modal/DeleteModal.svelte';
|
||||||
|
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
|
||||||
|
import { snackbar } from '$lib/components/Snackbar/store';
|
||||||
|
import UpgradeBanner from '$lib/components/Upgrade/Banner.svelte';
|
||||||
|
import UploadWidget from '$lib/components/UploadWidget/index.svelte';
|
||||||
|
import generateSlug from '$lib/utils/functions/generateSlug';
|
||||||
|
import { isObject } from '$lib/utils/functions/isObject';
|
||||||
|
import { t } from '$lib/utils/functions/translations';
|
||||||
|
import { deleteCourse, updateCourse } from '$lib/utils/services/courses';
|
||||||
|
import { currentOrg, currentOrgDomain, currentOrgPath, isFreePlan } from '$lib/utils/store/org';
|
||||||
|
import type { Course } from '$lib/utils/types';
|
||||||
import { COURSE_TYPE } from '$lib/utils/types';
|
import { COURSE_TYPE } from '$lib/utils/types';
|
||||||
|
import { lessons } from '../Lesson/store/lessons';
|
||||||
|
import { settings } from './store';
|
||||||
|
|
||||||
let isSaving = false;
|
let isSaving = false;
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
@@ -395,7 +394,7 @@
|
|||||||
<Toggle
|
<Toggle
|
||||||
size="sm"
|
size="sm"
|
||||||
bind:toggled={$settings.allow_new_students}
|
bind:toggled={$settings.allow_new_students}
|
||||||
on:toggle={() => {
|
on:click={() => {
|
||||||
hasUnsavedChanges = true;
|
hasUnsavedChanges = true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -415,9 +414,11 @@
|
|||||||
<Toggle
|
<Toggle
|
||||||
size="sm"
|
size="sm"
|
||||||
bind:toggled={$settings.is_published}
|
bind:toggled={$settings.is_published}
|
||||||
|
on:click={() => {
|
||||||
|
hasUnsavedChanges = true;
|
||||||
|
}}
|
||||||
on:toggle={(e) => {
|
on:toggle={(e) => {
|
||||||
$settings.allow_new_students = e.detail.toggled;
|
$settings.allow_new_students = e.detail.toggled;
|
||||||
hasUnsavedChanges = true;
|
|
||||||
if (!$course.slug) {
|
if (!$course.slug) {
|
||||||
generateNewCourseLink();
|
generateNewCourseLink();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import { goto } from '$app/navigation';
|
||||||
Tag,
|
|
||||||
ImageLoader,
|
|
||||||
SkeletonPlaceholder,
|
|
||||||
OverflowMenu,
|
|
||||||
OverflowMenuItem
|
|
||||||
} from 'carbon-components-svelte';
|
|
||||||
import getCurrencyFormatter from '$lib/utils/functions/getCurrencyFormatter';
|
|
||||||
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
|
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
|
||||||
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
||||||
|
import { calcCourseDiscount } from '$lib/utils/functions/course';
|
||||||
|
import getCurrencyFormatter from '$lib/utils/functions/getCurrencyFormatter';
|
||||||
import { t } from '$lib/utils/functions/translations';
|
import { t } from '$lib/utils/functions/translations';
|
||||||
import { COURSE_TYPE } from '$lib/utils/types';
|
import { COURSE_TYPE } from '$lib/utils/types';
|
||||||
import RadioButtonChecked from 'carbon-icons-svelte/lib/RadioButtonChecked.svelte';
|
import {
|
||||||
|
ImageLoader,
|
||||||
|
OverflowMenu,
|
||||||
|
OverflowMenuItem,
|
||||||
|
SkeletonPlaceholder,
|
||||||
|
Tag
|
||||||
|
} from 'carbon-components-svelte';
|
||||||
import GrowthIcon from 'carbon-icons-svelte/lib/Growth.svelte';
|
import GrowthIcon from 'carbon-icons-svelte/lib/Growth.svelte';
|
||||||
|
import RadioButtonChecked from 'carbon-icons-svelte/lib/RadioButtonChecked.svelte';
|
||||||
import UserProfileIcon from 'carbon-icons-svelte/lib/UserProfile.svelte';
|
import UserProfileIcon from 'carbon-icons-svelte/lib/UserProfile.svelte';
|
||||||
import { calcCourseDiscount } from '$lib/utils/functions/course';
|
|
||||||
import { goto } from '$app/navigation';
|
|
||||||
|
|
||||||
export let bannerImage: string | undefined;
|
export let bannerImage: string | undefined;
|
||||||
export let id = '';
|
export let id = '';
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
<div class="relative mb-5">
|
<div class="relative mb-5">
|
||||||
{#if !isLMS && !isOnLandingPage}
|
{#if !isLMS && !isOnLandingPage}
|
||||||
<OverflowMenu
|
<OverflowMenu
|
||||||
class="absolute right-2 top-2 z-50 hidden rounded-full bg-white group-hover:flex"
|
class="absolute right-2 top-2 z-50 rounded-full bg-gray-200 opacity-0 transition-all delay-150 duration-200 ease-in-out group-hover:opacity-100 dark:bg-neutral-800"
|
||||||
size="sm"
|
size="sm"
|
||||||
on:click={(e) => e.stopPropagation()}
|
on:click={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
@@ -235,10 +235,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
a,
|
|
||||||
a:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
.title,
|
.title,
|
||||||
.description {
|
.description {
|
||||||
height: 42px;
|
height: 42px;
|
||||||
|
|||||||
Reference in New Issue
Block a user