chore: update publish workflow to trigger on main branch and refine slug generation in course settings

This commit is contained in:
Rotimi Best
2026-03-13 20:18:46 +01:00
parent 492f8dc5ed
commit dd8c8137a0
7 changed files with 15 additions and 15 deletions
+6 -3
View File
@@ -3,12 +3,15 @@ name: Publish @classroomio/mcp to NPM
on:
workflow_dispatch:
pull_request:
branches:
- feat/release-v2
paths:
- ".github/workflows/publish-mcp.yml"
- "packages/mcp/**"
push:
paths:
- "packages/mcp/**"
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
@@ -25,7 +25,7 @@
import { t } from '$lib/utils/functions/translations';
import { isObject } from '$lib/utils/functions/isObject';
import { snackbar } from '$features/ui/snackbar/store';
import generateSlug from '$lib/utils/functions/generateSlug';
import { generateSlug } from '@cio/utils/functions';
import { DeleteModal } from '$features/ui';
import { courseApi } from '$features/course/api';
import { tagApi } from '$features/tag/api';
@@ -190,7 +190,7 @@
const generateNewCourseLink = () => {
if (!courseApi.course) return;
courseApi.course.slug = generateSlug(courseApi.course.title);
courseApi.course.slug = generateSlug(courseApi.course.title, { appendTimestamp: true });
hasUnsavedChanges = true;
};
@@ -31,7 +31,7 @@
import InstructorForm from './instructor-form.svelte';
import { Button } from '@cio/ui/base/button';
import { courseApi } from '$features/course/api';
import generateSlug from '$lib/utils/functions/generateSlug';
import { generateSlug } from '@cio/utils/functions';
import * as Sidebar from '@cio/ui/base/sidebar';
import { useSidebar } from '@cio/ui/base/sidebar';
@@ -147,7 +147,7 @@
async function handleSave() {
loading = true;
course.slug = course.slug || generateSlug(course.title);
course.slug = course.slug || generateSlug(course.title, { appendTimestamp: true });
console.log('course', course);
await courseApi.update(courseId, {
@@ -13,7 +13,7 @@
let { data } = $props();
let userCourseAnalytics: UserCourseAnalytics | undefined = $state(data.userCourseAnalytics ?? undefined);
let userCourseAnalytics: UserCourseAnalytics | undefined = $derived(data.userCourseAnalytics ?? undefined);
function getPercentage(a: number, b: number): number {
if (b === 0) {
@@ -32,7 +32,7 @@
}
let { data } = $props();
const { quizId } = data;
const quizId = $derived(data.quizId);
// Questionnaire State
let currentQuestion: QuizQuestion = $state(
@@ -17,7 +17,7 @@
config: ChartConfig;
} = $props();
const chartId = `chart-${id || uid.replace(/:/g, '')}`;
const chartId = $derived(`chart-${id || uid.replace(/:/g, '')}`);
setChartContext({
get config() {
@@ -22,10 +22,7 @@
...rest
}: CopyButtonProps = $props();
// this way if the user passes text then the button will be the default size
if (size === 'icon' && children) {
size = 'default';
}
const resolvedSize = $derived(size === 'icon' && children ? 'default' : size);
const clipboard = new UseClipboard();
</script>
@@ -34,7 +31,7 @@
{...rest}
bind:ref
{variant}
{size}
size={resolvedSize}
{tabindex}
class={cn('ui:flex ui:items-center ui:gap-2', className)}
type="button"