@burdenoff/microfe-buildmyiq 2026.1107.2 → 2026.1107.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildmyiq/hooks/useBuiMigration.d.ts +3 -3
- package/dist/buildmyiq/hooks/useBuiMigration.d.ts.map +1 -1
- package/dist/buildmyiq/hooks/useBuiMigration.js.map +1 -1
- package/dist/buildmyiq/hooks/useHrisDirectorySync.d.ts +21 -0
- package/dist/buildmyiq/hooks/useHrisDirectorySync.d.ts.map +1 -0
- package/dist/buildmyiq/hooks/useHrisDirectorySync.js +141 -0
- package/dist/buildmyiq/hooks/useHrisDirectorySync.js.map +1 -0
- package/dist/buildmyiq/pages/migration/MigrationCenterPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/migration/MigrationCenterPage.js +37 -37
- package/dist/buildmyiq/pages/migration/MigrationCenterPage.js.map +1 -1
- package/dist/buildmyiq/pages/provisioning/HrisConnectorsCard.d.ts +3 -0
- package/dist/buildmyiq/pages/provisioning/HrisConnectorsCard.d.ts.map +1 -0
- package/dist/buildmyiq/pages/provisioning/HrisConnectorsCard.js +428 -0
- package/dist/buildmyiq/pages/provisioning/HrisConnectorsCard.js.map +1 -0
- package/dist/buildmyiq/pages/provisioning/ProvisioningPage.d.ts.map +1 -1
- package/dist/buildmyiq/pages/provisioning/ProvisioningPage.js +110 -108
- package/dist/buildmyiq/pages/provisioning/ProvisioningPage.js.map +1 -1
- package/dist/buildmyiq/pages/provisioning/hrisModel.d.ts +100 -0
- package/dist/buildmyiq/pages/provisioning/hrisModel.d.ts.map +1 -0
- package/dist/buildmyiq/pages/provisioning/hrisModel.js +193 -0
- package/dist/buildmyiq/pages/provisioning/hrisModel.js.map +1 -0
- package/dist/buildmyiq/pages/provisioning/provisioningModel.d.ts.map +1 -1
- package/dist/buildmyiq/pages/provisioning/provisioningModel.js +4 -0
- package/dist/buildmyiq/pages/provisioning/provisioningModel.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationCenterPage.js","names":[],"sources":["../../../../src/buildmyiq/pages/migration/MigrationCenterPage.tsx"],"sourcesContent":["/**\n * MigrationCenterPage — move courses in from other LMSs and out to open formats (BOFF-4437).\n * @module buildmyiq/pages/migration\n *\n * Three tabs:\n * - Import: upload an IMS Common Cartridge (.imscc) exported from Canvas,\n * Blackboard Learn, Moodle, Brightspace or Schoology, review what will be\n * created (and every skipped or converted item), then import it as a new\n * draft course.\n * - Export: download a course as Common Cartridge 1.1 or BuildMyIQ JSON, or\n * its gradebook as CSV.\n * - History: the migration audit trail, with the issues of every run.\n */\n\nimport type { ChangeEvent, FC } from 'react';\nimport { useId, useRef, useState } from 'react';\nimport {\n AlertTriangle,\n ArrowRightLeft,\n CheckCircle2,\n Download,\n FileArchive,\n History,\n Info,\n Upload,\n XCircle,\n} from 'lucide-react';\nimport { Button, GlassCard, Input } from '@burdenoff/fe-libs/ui';\n\nimport {\n EmptyState,\n ErrorView,\n LoadingView,\n PageLayout,\n StatusBadge,\n Tabs,\n} from '../../components';\nimport { BuiPermissionButton } from '../../components/BuiPermissionButton';\nimport { useBuildmyiq } from '../../context';\nimport { useBuiCourses, useBuiFileUpload } from '../../hooks';\nimport {\n type BuiCourseExportFormat,\n type BuiCourseImportPreview,\n type BuiMigrationIssue,\n type BuiMigrationJob,\n MIGRATION_JOBS_PAGE_SIZE,\n saveExport,\n useBuiExportCourse,\n useBuiExportGradebook,\n useBuiImportCourse,\n useBuiMigrationJobs,\n useBuiPreviewCourseImport,\n} from '../../hooks/useBuiMigration';\nimport { formatDateTime, formatEnumLabel } from '../../utils/formatters';\nimport { Field, SelectField } from '../authoring/_forms';\n\ntype MigrationTab = 'import' | 'export' | 'history';\n\nconst ACCEPTED_PACKAGES = '.imscc,.zip,application/zip';\n\nconst SOURCE_STEPS: Array<{ lms: string; steps: string }> = [\n {\n lms: 'Canvas',\n steps:\n 'Settings → Export Course Content → Course → Create Export, then download the .imscc file.',\n },\n {\n lms: 'Blackboard Learn',\n steps:\n 'Course Management → Packages and Utilities → Export/Archive Course → Export to Common Cartridge.',\n },\n {\n lms: 'Moodle',\n steps:\n 'Use an IMS Common Cartridge export of the course (Moodle backups, .mbz, are not read yet).',\n },\n {\n lms: 'Brightspace (D2L)',\n steps: 'Course Admin → Import/Export/Copy Components → Export as Common Cartridge.',\n },\n];\n\nconst formatBytes = (bytes: number): string => {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n};\n\nconst errorMessage = (error: unknown, fallback: string): string =>\n error instanceof Error && error.message ? error.message : fallback;\n\nconst severityIcon = (severity: BuiMigrationIssue['severity']) => {\n if (severity === 'ERROR')\n return <XCircle aria-hidden=\"true\" className=\"h-4 w-4 shrink-0 text-status-error-text\" />;\n if (severity === 'WARNING')\n return (\n <AlertTriangle aria-hidden=\"true\" className=\"h-4 w-4 shrink-0 text-status-warning-text\" />\n );\n return <Info aria-hidden=\"true\" className=\"h-4 w-4 shrink-0 text-text-tertiary\" />;\n};\n\nconst SEVERITY_ORDER: Record<BuiMigrationIssue['severity'], number> = {\n ERROR: 0,\n WARNING: 1,\n INFO: 2,\n};\n\n/** Issues sorted by severity, each with its icon, message and package reference. */\nconst IssueList: FC<{ issues: BuiMigrationIssue[]; emptyText?: string }> = ({\n issues,\n emptyText,\n}) => {\n if (issues.length === 0) {\n return emptyText ? <p className=\"text-sm text-text-secondary\">{emptyText}</p> : null;\n }\n const sorted = [...issues].sort(\n (a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]\n );\n return (\n <ul className=\"flex flex-col gap-2\" aria-label=\"Migration issues\">\n {sorted.map((issue, index) => (\n <li key={`${issue.code}-${index}`} className=\"flex items-start gap-2 text-sm\">\n {severityIcon(issue.severity)}\n <span className=\"min-w-0\">\n <span className=\"sr-only\">{formatEnumLabel(issue.severity)}: </span>\n <span className=\"text-text-primary\">{issue.message}</span>\n {issue.ref && (\n <span className=\"ms-1 break-all font-mono text-xs text-text-tertiary\">\n ({issue.ref})\n </span>\n )}\n </span>\n </li>\n ))}\n </ul>\n );\n};\n\nconst StatTile: FC<{ label: string; value: number }> = ({ label, value }) => (\n <div className=\"rounded-lg border border-border-seam bg-bg-sunken px-3 py-2\">\n <dt className=\"text-xs text-text-tertiary\">{label}</dt>\n <dd className=\"text-lg font-semibold text-text-primary\">{value}</dd>\n </div>\n);\n\nconst PreviewCard: FC<{\n preview: BuiCourseImportPreview;\n fileId: string;\n onReset: () => void;\n}> = ({ preview, fileId, onReset }) => {\n const { navigateTo } = useBuildmyiq();\n const importCourse = useBuiImportCourse();\n const [title, setTitle] = useState(preview.title);\n const [error, setError] = useState<string | null>(null);\n const titleId = useId();\n\n const handleImport = async () => {\n setError(null);\n try {\n await importCourse.mutateAsync({ fileId, title: title.trim() || undefined });\n } catch (e) {\n setError(errorMessage(e, 'The course could not be imported.'));\n }\n };\n\n const imported = importCourse.data;\n if (imported) {\n return (\n <GlassCard\n treatment=\"plain\"\n className=\"flex flex-col gap-3 p-4\"\n data-testid=\"migration-import-done\"\n >\n <div className=\"flex items-center gap-2\">\n <CheckCircle2 aria-hidden=\"true\" className=\"h-5 w-5 text-status-success-text\" />\n <h2 className=\"font-semibold text-text-primary\">Imported “{imported.course.title}”</h2>\n </div>\n <p className=\"text-sm text-text-secondary\" role=\"status\">\n Created a draft course with {imported.job.stats.moduleCount} modules,{' '}\n {imported.job.stats.lessonCount} lessons and {imported.job.stats.assessmentCount} quizzes.\n Review it, attach any media the package referenced, and publish when it is ready.\n </p>\n <div className=\"flex flex-wrap gap-2\">\n <Button onClick={() => navigateTo(`authoring/${imported.course.id}`)}>\n Open in course builder\n </Button>\n <Button variant=\"outline\" onClick={onReset}>\n Import another package\n </Button>\n </div>\n </GlassCard>\n );\n }\n\n return (\n <GlassCard\n treatment=\"plain\"\n className=\"flex flex-col gap-4 p-4\"\n data-testid=\"migration-preview\"\n >\n <div className=\"flex flex-wrap items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <h2 className=\"font-semibold text-text-primary\">Review the import</h2>\n <p className=\"text-sm text-text-secondary\">\n {preview.fileName}\n {preview.sourceSystem ? ` · exported from ${preview.sourceSystem}` : ''}\n {preview.standardVersion ? ` · Common Cartridge ${preview.standardVersion}` : ''}\n {` · ${formatBytes(preview.stats.byteSize)}`}\n </p>\n </div>\n <Button variant=\"ghost\" size=\"sm\" onClick={onReset}>\n Choose another file\n </Button>\n </div>\n\n <dl className=\"grid grid-cols-2 gap-2 sm:grid-cols-5\">\n <StatTile label=\"Modules\" value={preview.stats.moduleCount} />\n <StatTile label=\"Lessons\" value={preview.stats.lessonCount} />\n <StatTile label=\"Quizzes\" value={preview.stats.assessmentCount} />\n <StatTile label=\"Questions\" value={preview.stats.questionCount} />\n <StatTile label=\"Skipped items\" value={preview.stats.skippedCount} />\n </dl>\n\n {preview.modules.length > 0 && (\n <section aria-labelledby={`${titleId}-outline`} className=\"flex flex-col gap-2\">\n <h3 id={`${titleId}-outline`} className=\"text-sm font-semibold text-text-primary\">\n Course outline\n </h3>\n <ol className=\"flex flex-col gap-2\">\n {preview.modules.map((module, moduleIndex) => (\n <li\n key={`${module.title}-${moduleIndex}`}\n className=\"rounded-lg border border-border-seam p-3\"\n >\n <p className=\"text-sm font-medium text-text-primary\">{module.title}</p>\n <ul className=\"mt-1 flex flex-col gap-0.5\">\n {module.items.map((item, itemIndex) => (\n <li\n key={`${item.title}-${itemIndex}`}\n className=\"flex flex-wrap items-center justify-between gap-2 text-sm text-text-secondary\"\n >\n <span className=\"min-w-0 truncate\">{item.title}</span>\n <span className=\"text-xs text-text-tertiary\">\n {item.kind === 'ASSESSMENT'\n ? `Quiz · ${item.detail}`\n : formatEnumLabel(item.detail)}\n </span>\n </li>\n ))}\n </ul>\n </li>\n ))}\n </ol>\n </section>\n )}\n\n <section aria-labelledby={`${titleId}-issues`} className=\"flex flex-col gap-2\">\n <h3 id={`${titleId}-issues`} className=\"text-sm font-semibold text-text-primary\">\n What will not come across as-is\n </h3>\n <IssueList issues={preview.issues} emptyText=\"Everything in the package can be imported.\" />\n </section>\n\n {preview.canImport ? (\n <div className=\"flex flex-col gap-3 border-t border-border-seam pt-4\">\n <Field label=\"Course title\" htmlFor={`${titleId}-title`}>\n <Input\n id={`${titleId}-title`}\n value={title}\n maxLength={255}\n onChange={(e) => setTitle(e.target.value)}\n />\n </Field>\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n <div>\n <BuiPermissionButton resource=\"buildmyiq-course\" action=\"create\">\n <Button\n onClick={handleImport}\n disabled={importCourse.isPending}\n data-testid=\"migration-import-button\"\n >\n {importCourse.isPending ? 'Importing…' : 'Import as draft course'}\n </Button>\n </BuiPermissionButton>\n </div>\n </div>\n ) : (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n This package cannot be imported. Fix the error above and upload it again.\n </p>\n )}\n </GlassCard>\n );\n};\n\nconst ImportTab: FC = () => {\n const fileInput = useRef<HTMLInputElement>(null);\n const { upload, isUploading, progress } = useBuiFileUpload({ visibility: 'PRIVATE' });\n const previewImport = useBuiPreviewCourseImport();\n const [fileId, setFileId] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const inputId = useId();\n\n const reset = () => {\n setFileId(null);\n setError(null);\n previewImport.reset();\n if (fileInput.current) fileInput.current.value = '';\n };\n\n const handleFile = async (event: ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (!file) return;\n setError(null);\n previewImport.reset();\n try {\n const uploaded = await upload(file);\n setFileId(uploaded.fileId);\n await previewImport.mutateAsync(uploaded.fileId);\n } catch (e) {\n setError(errorMessage(e, 'The package could not be read.'));\n }\n };\n\n const busy = isUploading || previewImport.isPending;\n\n return (\n <div className=\"flex flex-col gap-4\">\n <GlassCard treatment=\"plain\" className=\"flex flex-col gap-3 p-4\">\n <div>\n <h2 className=\"font-semibold text-text-primary\">Import a course from another LMS</h2>\n <p className=\"text-sm text-text-secondary\">\n Upload an IMS Common Cartridge (.imscc) package. Pages, links, discussions, assignments\n and quizzes become a draft course; nothing is published until you choose to.\n </p>\n </div>\n <ul className=\"grid gap-2 sm:grid-cols-2\">\n {SOURCE_STEPS.map((source) => (\n <li key={source.lms} className=\"rounded-lg border border-border-seam p-3 text-sm\">\n <p className=\"font-medium text-text-primary\">{source.lms}</p>\n <p className=\"text-text-secondary\">{source.steps}</p>\n </li>\n ))}\n </ul>\n <div className=\"flex flex-wrap items-center gap-3\">\n <input\n ref={fileInput}\n id={inputId}\n type=\"file\"\n accept={ACCEPTED_PACKAGES}\n className=\"sr-only\"\n onChange={handleFile}\n disabled={busy}\n data-testid=\"migration-file-input\"\n />\n <BuiPermissionButton resource=\"buildmyiq-course\" action=\"create\">\n <Button onClick={() => fileInput.current?.click()} disabled={busy}>\n <Upload aria-hidden=\"true\" className=\"me-1.5 h-4 w-4\" />\n {isUploading\n ? `Uploading… ${progress}%`\n : previewImport.isPending\n ? 'Reading package…'\n : 'Choose a .imscc package'}\n </Button>\n </BuiPermissionButton>\n <label htmlFor={inputId} className=\"text-xs text-text-tertiary\">\n Up to 50 MB. The file is stored privately and only you can import it.\n </label>\n </div>\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n </GlassCard>\n\n {previewImport.data && fileId && (\n <PreviewCard key={fileId} preview={previewImport.data} fileId={fileId} onReset={reset} />\n )}\n </div>\n );\n};\n\nconst EXPORT_FORMATS: Array<{ value: BuiCourseExportFormat; label: string }> = [\n { value: 'COMMON_CARTRIDGE', label: 'IMS Common Cartridge 1.1 (.imscc)' },\n { value: 'BUILDMYIQ_JSON', label: 'BuildMyIQ course JSON (.json)' },\n];\n\nconst ExportTab: FC = () => {\n const courses = useBuiCourses({ limit: 100 });\n const exportCourse = useBuiExportCourse();\n const exportGradebook = useBuiExportGradebook();\n const [courseId, setCourseId] = useState('');\n const [format, setFormat] = useState<BuiCourseExportFormat>('COMMON_CARTRIDGE');\n const [message, setMessage] = useState<{ kind: 'ok' | 'error'; text: string } | null>(null);\n const courseFieldId = useId();\n const formatFieldId = useId();\n\n const items = courses.data?.items ?? [];\n const busy = exportCourse.isPending || exportGradebook.isPending;\n\n const run = async (kind: 'course' | 'gradebook') => {\n if (!courseId) return;\n setMessage(null);\n try {\n const exported =\n kind === 'course'\n ? await exportCourse.mutateAsync({ courseId, format })\n : await exportGradebook.mutateAsync(courseId);\n saveExport(exported);\n setMessage({\n kind: 'ok',\n text: `Downloaded ${exported.fileName} (${formatBytes(exported.byteSize)}).`,\n });\n } catch (e) {\n setMessage({ kind: 'error', text: errorMessage(e, 'The export failed.') });\n }\n };\n\n if (courses.isLoading) return <LoadingView label=\"Loading courses…\" />;\n if (courses.isError)\n return <ErrorView message=\"We couldn't load your courses.\" onRetry={() => courses.refetch()} />;\n if (items.length === 0) {\n return (\n <EmptyState\n illustration=\"empty-data\"\n icon={<FileArchive className=\"h-10 w-10\" />}\n title=\"No courses to export\"\n description=\"Create or import a course first.\"\n />\n );\n }\n\n return (\n <GlassCard treatment=\"plain\" className=\"flex flex-col gap-4 p-4\">\n <div>\n <h2 className=\"font-semibold text-text-primary\">Export a course</h2>\n <p className=\"text-sm text-text-secondary\">\n Common Cartridge opens in Canvas, Blackboard, Moodle and Brightspace. The JSON export\n keeps every BuildMyIQ field. Exports include quiz answer keys, so keep them private. The\n gradebook CSV lists each enrollment with its progress and best quiz scores.\n </p>\n </div>\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <Field label=\"Course\" htmlFor={courseFieldId} required>\n <SelectField\n id={courseFieldId}\n value={courseId}\n onChange={setCourseId}\n placeholder=\"Choose a course\"\n options={items.map((course) => ({ value: course.id, label: course.title }))}\n />\n </Field>\n <Field label=\"Course format\" htmlFor={formatFieldId}>\n <SelectField\n id={formatFieldId}\n value={format}\n onChange={(value) => setFormat(value as BuiCourseExportFormat)}\n options={EXPORT_FORMATS}\n />\n </Field>\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <BuiPermissionButton resource=\"buildmyiq-course\" action=\"update\">\n <Button\n onClick={() => run('course')}\n disabled={!courseId || busy}\n data-testid=\"migration-export-course\"\n >\n <Download aria-hidden=\"true\" className=\"me-1.5 h-4 w-4\" />\n {exportCourse.isPending ? 'Exporting…' : 'Export course'}\n </Button>\n </BuiPermissionButton>\n <BuiPermissionButton resource=\"buildmyiq-submission\" action=\"list\">\n <Button\n variant=\"outline\"\n onClick={() => run('gradebook')}\n disabled={!courseId || busy}\n data-testid=\"migration-export-gradebook\"\n >\n <Download aria-hidden=\"true\" className=\"me-1.5 h-4 w-4\" />\n {exportGradebook.isPending ? 'Exporting…' : 'Export gradebook (CSV)'}\n </Button>\n </BuiPermissionButton>\n </div>\n {message && (\n <p\n role={message.kind === 'error' ? 'alert' : 'status'}\n className={\n message.kind === 'error'\n ? 'text-sm text-status-error-text'\n : 'text-sm text-text-secondary'\n }\n >\n {message.text}\n </p>\n )}\n </GlassCard>\n );\n};\n\nconst KIND_LABEL: Record<BuiMigrationJob['kind'], string> = {\n COURSE_IMPORT: 'Course import',\n COURSE_EXPORT: 'Course export',\n GRADEBOOK_EXPORT: 'Gradebook export',\n};\n\nconst JobRow: FC<{ job: BuiMigrationJob }> = ({ job }) => {\n const [open, setOpen] = useState(false);\n const detailsId = useId();\n const counts =\n job.kind === 'GRADEBOOK_EXPORT'\n ? `${job.stats.rowCount} rows`\n : `${job.stats.moduleCount} modules · ${job.stats.lessonCount} lessons · ${job.stats.assessmentCount} quizzes`;\n return (\n <li className=\"rounded-lg border border-border-seam p-3\" data-testid=\"migration-job\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"flex flex-wrap items-center gap-2 text-sm font-medium text-text-primary\">\n {KIND_LABEL[job.kind]}\n <StatusBadge status={job.status} />\n <span className=\"text-xs font-normal text-text-tertiary\">\n {formatEnumLabel(job.format)}\n </span>\n </p>\n <p className=\"truncate text-sm text-text-secondary\">\n {job.courseTitle ?? job.fileName ?? 'Untitled'}\n {job.sourceSystem ? ` · from ${job.sourceSystem}` : ''} · {counts}\n </p>\n <p className=\"text-xs text-text-tertiary\">{formatDateTime(job.createdAt)}</p>\n </div>\n {job.issues.length > 0 && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-expanded={open}\n aria-controls={detailsId}\n onClick={() => setOpen((v) => !v)}\n >\n {open ? 'Hide' : 'Show'} {job.issues.length} note{job.issues.length === 1 ? '' : 's'}\n </Button>\n )}\n </div>\n {open && (\n <div id={detailsId} className=\"mt-3 border-t border-border-seam pt-3\">\n <IssueList issues={job.issues} />\n </div>\n )}\n </li>\n );\n};\n\nconst HistoryTab: FC = () => {\n const [offset, setOffset] = useState(0);\n const jobs = useBuiMigrationJobs(offset);\n if (jobs.isLoading) return <LoadingView label=\"Loading migration history…\" />;\n if (jobs.isError)\n return (\n <ErrorView message=\"We couldn't load the migration history.\" onRetry={() => jobs.refetch()} />\n );\n const items = jobs.data?.items ?? [];\n if (items.length === 0 && offset === 0) {\n return (\n <EmptyState\n illustration=\"empty-data\"\n icon={<History className=\"h-10 w-10\" />}\n title=\"No migrations yet\"\n description=\"Imports and exports appear here with everything that was skipped or converted.\"\n />\n );\n }\n return (\n <div className=\"flex flex-col gap-3\">\n <ul className=\"flex flex-col gap-2\" aria-label=\"Migration history\">\n {items.map((job) => (\n <JobRow key={job.id} job={job} />\n ))}\n </ul>\n <div className=\"flex justify-between\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={offset === 0}\n onClick={() => setOffset(Math.max(0, offset - MIGRATION_JOBS_PAGE_SIZE))}\n >\n Newer\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!jobs.data?.pageInfo.hasMore}\n onClick={() => setOffset(offset + MIGRATION_JOBS_PAGE_SIZE)}\n >\n Older\n </Button>\n </div>\n </div>\n );\n};\n\nexport const MigrationCenterPage: FC = () => {\n const [tab, setTab] = useState<MigrationTab>('import');\n return (\n <PageLayout\n title=\"Migration\"\n description=\"Bring courses over from Canvas, Blackboard, Moodle and other LMSs with IMS Common Cartridge, and export courses and gradebooks in open formats.\"\n titleGradient\n >\n <div className=\"flex flex-col gap-4\">\n <Tabs<MigrationTab>\n value={tab}\n onChange={setTab}\n items={[\n { value: 'import', label: 'Import', icon: <Upload className=\"h-4 w-4\" /> },\n { value: 'export', label: 'Export', icon: <ArrowRightLeft className=\"h-4 w-4\" /> },\n { value: 'history', label: 'History', icon: <History className=\"h-4 w-4\" /> },\n ]}\n />\n <div role=\"tabpanel\" aria-label={formatEnumLabel(tab)}>\n {tab === 'import' && <ImportTab />}\n {tab === 'export' && <ExportTab />}\n {tab === 'history' && <HistoryTab />}\n </div>\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0DA,IAAM,IAAoB,+BAEpB,IAAsD;CAC1D;EACE,KAAK;EACL,OACE;CACJ;CACA;EACE,KAAK;EACL,OACE;CACJ;CACA;EACE,KAAK;EACL,OACE;CACJ;CACA;EACE,KAAK;EACL,OAAO;CACT;AACF,GAEM,KAAe,MACf,IAAQ,OAAa,GAAG,EAAM,MAC9B,IAAQ,OAAO,OAAa,IAAI,IAAQ,KAAA,CAAM,QAAQ,CAAC,EAAE,OACtD,IAAI,IAAQ,OAAO,KAAA,CAAM,QAAQ,CAAC,EAAE,MAGvC,KAAgB,GAAgB,MACpC,aAAiB,SAAS,EAAM,UAAU,EAAM,UAAU,GAEtD,KAAgB,MAChB,MAAa,UACR,kBAAC,GAAD;CAAS,eAAY;CAAO,WAAU;AAA2C,CAAA,IACtF,MAAa,YAEb,kBAAC,GAAD;CAAe,eAAY;CAAO,WAAU;AAA6C,CAAA,IAEtF,kBAAC,GAAD;CAAM,eAAY;CAAO,WAAU;AAAuC,CAAA,GAG7E,IAAgE;CACpE,OAAO;CACP,SAAS;CACT,MAAM;AACR,GAGM,KAAsE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ACK,CAAA;AAEhB"}
|
|
1
|
+
{"version":3,"file":"MigrationCenterPage.js","names":[],"sources":["../../../../src/buildmyiq/pages/migration/MigrationCenterPage.tsx"],"sourcesContent":["/**\n * MigrationCenterPage — move courses in from other LMSs and out to open formats (BOFF-4437).\n * @module buildmyiq/pages/migration\n *\n * Three tabs:\n * - Import: upload an IMS Common Cartridge (.imscc) exported from Canvas,\n * Blackboard Learn, Moodle, Brightspace or Schoology, or a native Moodle\n * course backup (.mbz, BOFF-10577), review what will be created (and\n * every skipped or converted item), then import it as a new draft course.\n * - Export: download a course as Common Cartridge 1.1 or BuildMyIQ JSON, or\n * its gradebook as CSV.\n * - History: the migration audit trail, with the issues of every run.\n */\n\nimport type { ChangeEvent, FC } from 'react';\nimport { useId, useRef, useState } from 'react';\nimport {\n AlertTriangle,\n ArrowRightLeft,\n CheckCircle2,\n Download,\n FileArchive,\n History,\n Info,\n Upload,\n XCircle,\n} from 'lucide-react';\nimport { Button, GlassCard, Input } from '@burdenoff/fe-libs/ui';\n\nimport {\n EmptyState,\n ErrorView,\n LoadingView,\n PageLayout,\n StatusBadge,\n Tabs,\n} from '../../components';\nimport { BuiPermissionButton } from '../../components/BuiPermissionButton';\nimport { useBuildmyiq } from '../../context';\nimport { useBuiCourses, useBuiFileUpload } from '../../hooks';\nimport {\n type BuiCourseExportFormat,\n type BuiCourseImportPreview,\n type BuiMigrationIssue,\n type BuiMigrationJob,\n MIGRATION_JOBS_PAGE_SIZE,\n saveExport,\n useBuiExportCourse,\n useBuiExportGradebook,\n useBuiImportCourse,\n useBuiMigrationJobs,\n useBuiPreviewCourseImport,\n} from '../../hooks/useBuiMigration';\nimport { formatDateTime, formatEnumLabel } from '../../utils/formatters';\nimport { Field, SelectField } from '../authoring/_forms';\n\ntype MigrationTab = 'import' | 'export' | 'history';\n\nconst ACCEPTED_PACKAGES =\n '.imscc,.zip,.mbz,application/zip,application/gzip,application/x-gzip,application/vnd.moodle.backup';\n\nconst SOURCE_STEPS: Array<{ lms: string; steps: string }> = [\n {\n lms: 'Canvas',\n steps:\n 'Settings → Export Course Content → Course → Create Export, then download the .imscc file.',\n },\n {\n lms: 'Blackboard Learn',\n steps:\n 'Course Management → Packages and Utilities → Export/Archive Course → Export to Common Cartridge.',\n },\n {\n lms: 'Moodle',\n steps:\n 'Course → Backup, keep the defaults (no user data needed), then download the .mbz file. A Common Cartridge export works too.',\n },\n {\n lms: 'Brightspace (D2L)',\n steps: 'Course Admin → Import/Export/Copy Components → Export as Common Cartridge.',\n },\n];\n\nconst formatBytes = (bytes: number): string => {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n};\n\n/** \"Moodle backup (Moodle 4.1.2)\" / \"Common Cartridge 1.1.0\" for the preview header. */\nconst packageLabel = (preview: BuiCourseImportPreview): string => {\n if (preview.format === 'MOODLE_BACKUP') {\n return preview.standardVersion\n ? `Moodle backup (Moodle ${preview.standardVersion})`\n : 'Moodle backup';\n }\n return preview.standardVersion\n ? `Common Cartridge ${preview.standardVersion}`\n : 'Common Cartridge';\n};\n\nconst errorMessage = (error: unknown, fallback: string): string =>\n error instanceof Error && error.message ? error.message : fallback;\n\nconst severityIcon = (severity: BuiMigrationIssue['severity']) => {\n if (severity === 'ERROR')\n return <XCircle aria-hidden=\"true\" className=\"h-4 w-4 shrink-0 text-status-error-text\" />;\n if (severity === 'WARNING')\n return (\n <AlertTriangle aria-hidden=\"true\" className=\"h-4 w-4 shrink-0 text-status-warning-text\" />\n );\n return <Info aria-hidden=\"true\" className=\"h-4 w-4 shrink-0 text-text-tertiary\" />;\n};\n\nconst SEVERITY_ORDER: Record<BuiMigrationIssue['severity'], number> = {\n ERROR: 0,\n WARNING: 1,\n INFO: 2,\n};\n\n/** Issues sorted by severity, each with its icon, message and package reference. */\nconst IssueList: FC<{ issues: BuiMigrationIssue[]; emptyText?: string }> = ({\n issues,\n emptyText,\n}) => {\n if (issues.length === 0) {\n return emptyText ? <p className=\"text-sm text-text-secondary\">{emptyText}</p> : null;\n }\n const sorted = [...issues].sort(\n (a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]\n );\n return (\n <ul className=\"flex flex-col gap-2\" aria-label=\"Migration issues\">\n {sorted.map((issue, index) => (\n <li key={`${issue.code}-${index}`} className=\"flex items-start gap-2 text-sm\">\n {severityIcon(issue.severity)}\n <span className=\"min-w-0\">\n <span className=\"sr-only\">{formatEnumLabel(issue.severity)}: </span>\n <span className=\"text-text-primary\">{issue.message}</span>\n {issue.ref && (\n <span className=\"ms-1 break-all font-mono text-xs text-text-tertiary\">\n ({issue.ref})\n </span>\n )}\n </span>\n </li>\n ))}\n </ul>\n );\n};\n\nconst StatTile: FC<{ label: string; value: number }> = ({ label, value }) => (\n <div className=\"rounded-lg border border-border-seam bg-bg-sunken px-3 py-2\">\n <dt className=\"text-xs text-text-tertiary\">{label}</dt>\n <dd className=\"text-lg font-semibold text-text-primary\">{value}</dd>\n </div>\n);\n\nconst PreviewCard: FC<{\n preview: BuiCourseImportPreview;\n fileId: string;\n onReset: () => void;\n}> = ({ preview, fileId, onReset }) => {\n const { navigateTo } = useBuildmyiq();\n const importCourse = useBuiImportCourse();\n const [title, setTitle] = useState(preview.title);\n const [error, setError] = useState<string | null>(null);\n const titleId = useId();\n\n const handleImport = async () => {\n setError(null);\n try {\n await importCourse.mutateAsync({ fileId, title: title.trim() || undefined });\n } catch (e) {\n setError(errorMessage(e, 'The course could not be imported.'));\n }\n };\n\n const imported = importCourse.data;\n if (imported) {\n return (\n <GlassCard\n treatment=\"plain\"\n className=\"flex flex-col gap-3 p-4\"\n data-testid=\"migration-import-done\"\n >\n <div className=\"flex items-center gap-2\">\n <CheckCircle2 aria-hidden=\"true\" className=\"h-5 w-5 text-status-success-text\" />\n <h2 className=\"font-semibold text-text-primary\">Imported “{imported.course.title}”</h2>\n </div>\n <p className=\"text-sm text-text-secondary\" role=\"status\">\n Created a draft course with {imported.job.stats.moduleCount} modules,{' '}\n {imported.job.stats.lessonCount} lessons and {imported.job.stats.assessmentCount} quizzes.\n Review it, attach any media the package referenced, and publish when it is ready.\n </p>\n <div className=\"flex flex-wrap gap-2\">\n <Button onClick={() => navigateTo(`authoring/${imported.course.id}`)}>\n Open in course builder\n </Button>\n <Button variant=\"outline\" onClick={onReset}>\n Import another package\n </Button>\n </div>\n </GlassCard>\n );\n }\n\n return (\n <GlassCard\n treatment=\"plain\"\n className=\"flex flex-col gap-4 p-4\"\n data-testid=\"migration-preview\"\n >\n <div className=\"flex flex-wrap items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <h2 className=\"font-semibold text-text-primary\">Review the import</h2>\n <p className=\"text-sm text-text-secondary\">\n {preview.fileName}\n {preview.sourceSystem ? ` · exported from ${preview.sourceSystem}` : ''}\n {` · ${packageLabel(preview)}`}\n {` · ${formatBytes(preview.stats.byteSize)}`}\n </p>\n </div>\n <Button variant=\"ghost\" size=\"sm\" onClick={onReset}>\n Choose another file\n </Button>\n </div>\n\n <dl className=\"grid grid-cols-2 gap-2 sm:grid-cols-5\">\n <StatTile label=\"Modules\" value={preview.stats.moduleCount} />\n <StatTile label=\"Lessons\" value={preview.stats.lessonCount} />\n <StatTile label=\"Quizzes\" value={preview.stats.assessmentCount} />\n <StatTile label=\"Questions\" value={preview.stats.questionCount} />\n <StatTile label=\"Skipped items\" value={preview.stats.skippedCount} />\n </dl>\n\n {preview.modules.length > 0 && (\n <section aria-labelledby={`${titleId}-outline`} className=\"flex flex-col gap-2\">\n <h3 id={`${titleId}-outline`} className=\"text-sm font-semibold text-text-primary\">\n Course outline\n </h3>\n <ol className=\"flex flex-col gap-2\">\n {preview.modules.map((module, moduleIndex) => (\n <li\n key={`${module.title}-${moduleIndex}`}\n className=\"rounded-lg border border-border-seam p-3\"\n >\n <p className=\"text-sm font-medium text-text-primary\">{module.title}</p>\n <ul className=\"mt-1 flex flex-col gap-0.5\">\n {module.items.map((item, itemIndex) => (\n <li\n key={`${item.title}-${itemIndex}`}\n className=\"flex flex-wrap items-center justify-between gap-2 text-sm text-text-secondary\"\n >\n <span className=\"min-w-0 truncate\">{item.title}</span>\n <span className=\"text-xs text-text-tertiary\">\n {item.kind === 'ASSESSMENT'\n ? `Quiz · ${item.detail}`\n : formatEnumLabel(item.detail)}\n </span>\n </li>\n ))}\n </ul>\n </li>\n ))}\n </ol>\n </section>\n )}\n\n <section aria-labelledby={`${titleId}-issues`} className=\"flex flex-col gap-2\">\n <h3 id={`${titleId}-issues`} className=\"text-sm font-semibold text-text-primary\">\n What will not come across as-is\n </h3>\n <IssueList issues={preview.issues} emptyText=\"Everything in the package can be imported.\" />\n </section>\n\n {preview.canImport ? (\n <div className=\"flex flex-col gap-3 border-t border-border-seam pt-4\">\n <Field label=\"Course title\" htmlFor={`${titleId}-title`}>\n <Input\n id={`${titleId}-title`}\n value={title}\n maxLength={255}\n onChange={(e) => setTitle(e.target.value)}\n />\n </Field>\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n <div>\n <BuiPermissionButton resource=\"buildmyiq-course\" action=\"create\">\n <Button\n onClick={handleImport}\n disabled={importCourse.isPending}\n data-testid=\"migration-import-button\"\n >\n {importCourse.isPending ? 'Importing…' : 'Import as draft course'}\n </Button>\n </BuiPermissionButton>\n </div>\n </div>\n ) : (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n This package cannot be imported. Fix the error above and upload it again.\n </p>\n )}\n </GlassCard>\n );\n};\n\nconst ImportTab: FC = () => {\n const fileInput = useRef<HTMLInputElement>(null);\n const { upload, isUploading, progress } = useBuiFileUpload({ visibility: 'PRIVATE' });\n const previewImport = useBuiPreviewCourseImport();\n const [fileId, setFileId] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const inputId = useId();\n\n const reset = () => {\n setFileId(null);\n setError(null);\n previewImport.reset();\n if (fileInput.current) fileInput.current.value = '';\n };\n\n const handleFile = async (event: ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (!file) return;\n setError(null);\n previewImport.reset();\n try {\n const uploaded = await upload(file);\n setFileId(uploaded.fileId);\n await previewImport.mutateAsync(uploaded.fileId);\n } catch (e) {\n setError(errorMessage(e, 'The package could not be read.'));\n }\n };\n\n const busy = isUploading || previewImport.isPending;\n\n return (\n <div className=\"flex flex-col gap-4\">\n <GlassCard treatment=\"plain\" className=\"flex flex-col gap-3 p-4\">\n <div>\n <h2 className=\"font-semibold text-text-primary\">Import a course from another LMS</h2>\n <p className=\"text-sm text-text-secondary\">\n Upload an IMS Common Cartridge (.imscc) package or a Moodle course backup (.mbz). Pages,\n links, discussions, assignments and quizzes become a draft course; nothing is published\n until you choose to.\n </p>\n </div>\n <ul className=\"grid gap-2 sm:grid-cols-2\">\n {SOURCE_STEPS.map((source) => (\n <li key={source.lms} className=\"rounded-lg border border-border-seam p-3 text-sm\">\n <p className=\"font-medium text-text-primary\">{source.lms}</p>\n <p className=\"text-text-secondary\">{source.steps}</p>\n </li>\n ))}\n </ul>\n <div className=\"flex flex-wrap items-center gap-3\">\n <input\n ref={fileInput}\n id={inputId}\n type=\"file\"\n accept={ACCEPTED_PACKAGES}\n className=\"sr-only\"\n onChange={handleFile}\n disabled={busy}\n data-testid=\"migration-file-input\"\n />\n <BuiPermissionButton resource=\"buildmyiq-course\" action=\"create\">\n <Button onClick={() => fileInput.current?.click()} disabled={busy}>\n <Upload aria-hidden=\"true\" className=\"me-1.5 h-4 w-4\" />\n {isUploading\n ? `Uploading… ${progress}%`\n : previewImport.isPending\n ? 'Reading package…'\n : 'Choose a .imscc or .mbz file'}\n </Button>\n </BuiPermissionButton>\n <label htmlFor={inputId} className=\"text-xs text-text-tertiary\">\n Up to 50 MB. The file is stored privately and only you can import it.\n </label>\n </div>\n {error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {error}\n </p>\n )}\n </GlassCard>\n\n {previewImport.data && fileId && (\n <PreviewCard key={fileId} preview={previewImport.data} fileId={fileId} onReset={reset} />\n )}\n </div>\n );\n};\n\nconst EXPORT_FORMATS: Array<{ value: BuiCourseExportFormat; label: string }> = [\n { value: 'COMMON_CARTRIDGE', label: 'IMS Common Cartridge 1.1 (.imscc)' },\n { value: 'BUILDMYIQ_JSON', label: 'BuildMyIQ course JSON (.json)' },\n];\n\nconst ExportTab: FC = () => {\n const courses = useBuiCourses({ limit: 100 });\n const exportCourse = useBuiExportCourse();\n const exportGradebook = useBuiExportGradebook();\n const [courseId, setCourseId] = useState('');\n const [format, setFormat] = useState<BuiCourseExportFormat>('COMMON_CARTRIDGE');\n const [message, setMessage] = useState<{ kind: 'ok' | 'error'; text: string } | null>(null);\n const courseFieldId = useId();\n const formatFieldId = useId();\n\n const items = courses.data?.items ?? [];\n const busy = exportCourse.isPending || exportGradebook.isPending;\n\n const run = async (kind: 'course' | 'gradebook') => {\n if (!courseId) return;\n setMessage(null);\n try {\n const exported =\n kind === 'course'\n ? await exportCourse.mutateAsync({ courseId, format })\n : await exportGradebook.mutateAsync(courseId);\n saveExport(exported);\n setMessage({\n kind: 'ok',\n text: `Downloaded ${exported.fileName} (${formatBytes(exported.byteSize)}).`,\n });\n } catch (e) {\n setMessage({ kind: 'error', text: errorMessage(e, 'The export failed.') });\n }\n };\n\n if (courses.isLoading) return <LoadingView label=\"Loading courses…\" />;\n if (courses.isError)\n return <ErrorView message=\"We couldn't load your courses.\" onRetry={() => courses.refetch()} />;\n if (items.length === 0) {\n return (\n <EmptyState\n illustration=\"empty-data\"\n icon={<FileArchive className=\"h-10 w-10\" />}\n title=\"No courses to export\"\n description=\"Create or import a course first.\"\n />\n );\n }\n\n return (\n <GlassCard treatment=\"plain\" className=\"flex flex-col gap-4 p-4\">\n <div>\n <h2 className=\"font-semibold text-text-primary\">Export a course</h2>\n <p className=\"text-sm text-text-secondary\">\n Common Cartridge opens in Canvas, Blackboard, Moodle and Brightspace. The JSON export\n keeps every BuildMyIQ field. Exports include quiz answer keys, so keep them private. The\n gradebook CSV lists each enrollment with its progress and best quiz scores.\n </p>\n </div>\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <Field label=\"Course\" htmlFor={courseFieldId} required>\n <SelectField\n id={courseFieldId}\n value={courseId}\n onChange={setCourseId}\n placeholder=\"Choose a course\"\n options={items.map((course) => ({ value: course.id, label: course.title }))}\n />\n </Field>\n <Field label=\"Course format\" htmlFor={formatFieldId}>\n <SelectField\n id={formatFieldId}\n value={format}\n onChange={(value) => setFormat(value as BuiCourseExportFormat)}\n options={EXPORT_FORMATS}\n />\n </Field>\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <BuiPermissionButton resource=\"buildmyiq-course\" action=\"update\">\n <Button\n onClick={() => run('course')}\n disabled={!courseId || busy}\n data-testid=\"migration-export-course\"\n >\n <Download aria-hidden=\"true\" className=\"me-1.5 h-4 w-4\" />\n {exportCourse.isPending ? 'Exporting…' : 'Export course'}\n </Button>\n </BuiPermissionButton>\n <BuiPermissionButton resource=\"buildmyiq-submission\" action=\"list\">\n <Button\n variant=\"outline\"\n onClick={() => run('gradebook')}\n disabled={!courseId || busy}\n data-testid=\"migration-export-gradebook\"\n >\n <Download aria-hidden=\"true\" className=\"me-1.5 h-4 w-4\" />\n {exportGradebook.isPending ? 'Exporting…' : 'Export gradebook (CSV)'}\n </Button>\n </BuiPermissionButton>\n </div>\n {message && (\n <p\n role={message.kind === 'error' ? 'alert' : 'status'}\n className={\n message.kind === 'error'\n ? 'text-sm text-status-error-text'\n : 'text-sm text-text-secondary'\n }\n >\n {message.text}\n </p>\n )}\n </GlassCard>\n );\n};\n\nconst KIND_LABEL: Record<BuiMigrationJob['kind'], string> = {\n COURSE_IMPORT: 'Course import',\n COURSE_EXPORT: 'Course export',\n GRADEBOOK_EXPORT: 'Gradebook export',\n};\n\nconst JobRow: FC<{ job: BuiMigrationJob }> = ({ job }) => {\n const [open, setOpen] = useState(false);\n const detailsId = useId();\n const counts =\n job.kind === 'GRADEBOOK_EXPORT'\n ? `${job.stats.rowCount} rows`\n : `${job.stats.moduleCount} modules · ${job.stats.lessonCount} lessons · ${job.stats.assessmentCount} quizzes`;\n return (\n <li className=\"rounded-lg border border-border-seam p-3\" data-testid=\"migration-job\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"flex flex-wrap items-center gap-2 text-sm font-medium text-text-primary\">\n {KIND_LABEL[job.kind]}\n <StatusBadge status={job.status} />\n <span className=\"text-xs font-normal text-text-tertiary\">\n {formatEnumLabel(job.format)}\n </span>\n </p>\n <p className=\"truncate text-sm text-text-secondary\">\n {job.courseTitle ?? job.fileName ?? 'Untitled'}\n {job.sourceSystem ? ` · from ${job.sourceSystem}` : ''} · {counts}\n </p>\n <p className=\"text-xs text-text-tertiary\">{formatDateTime(job.createdAt)}</p>\n </div>\n {job.issues.length > 0 && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-expanded={open}\n aria-controls={detailsId}\n onClick={() => setOpen((v) => !v)}\n >\n {open ? 'Hide' : 'Show'} {job.issues.length} note{job.issues.length === 1 ? '' : 's'}\n </Button>\n )}\n </div>\n {open && (\n <div id={detailsId} className=\"mt-3 border-t border-border-seam pt-3\">\n <IssueList issues={job.issues} />\n </div>\n )}\n </li>\n );\n};\n\nconst HistoryTab: FC = () => {\n const [offset, setOffset] = useState(0);\n const jobs = useBuiMigrationJobs(offset);\n if (jobs.isLoading) return <LoadingView label=\"Loading migration history…\" />;\n if (jobs.isError)\n return (\n <ErrorView message=\"We couldn't load the migration history.\" onRetry={() => jobs.refetch()} />\n );\n const items = jobs.data?.items ?? [];\n if (items.length === 0 && offset === 0) {\n return (\n <EmptyState\n illustration=\"empty-data\"\n icon={<History className=\"h-10 w-10\" />}\n title=\"No migrations yet\"\n description=\"Imports and exports appear here with everything that was skipped or converted.\"\n />\n );\n }\n return (\n <div className=\"flex flex-col gap-3\">\n <ul className=\"flex flex-col gap-2\" aria-label=\"Migration history\">\n {items.map((job) => (\n <JobRow key={job.id} job={job} />\n ))}\n </ul>\n <div className=\"flex justify-between\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={offset === 0}\n onClick={() => setOffset(Math.max(0, offset - MIGRATION_JOBS_PAGE_SIZE))}\n >\n Newer\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!jobs.data?.pageInfo.hasMore}\n onClick={() => setOffset(offset + MIGRATION_JOBS_PAGE_SIZE)}\n >\n Older\n </Button>\n </div>\n </div>\n );\n};\n\nexport const MigrationCenterPage: FC = () => {\n const [tab, setTab] = useState<MigrationTab>('import');\n return (\n <PageLayout\n title=\"Migration\"\n description=\"Bring courses over from Canvas, Blackboard, Moodle and other LMSs with IMS Common Cartridge, and export courses and gradebooks in open formats.\"\n titleGradient\n >\n <div className=\"flex flex-col gap-4\">\n <Tabs<MigrationTab>\n value={tab}\n onChange={setTab}\n items={[\n { value: 'import', label: 'Import', icon: <Upload className=\"h-4 w-4\" /> },\n { value: 'export', label: 'Export', icon: <ArrowRightLeft className=\"h-4 w-4\" /> },\n { value: 'history', label: 'History', icon: <History className=\"h-4 w-4\" /> },\n ]}\n />\n <div role=\"tabpanel\" aria-label={formatEnumLabel(tab)}>\n {tab === 'import' && <ImportTab />}\n {tab === 'export' && <ExportTab />}\n {tab === 'history' && <HistoryTab />}\n </div>\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0DA,IAAM,IACJ,sGAEI,IAAsD;CAC1D;EACE,KAAK;EACL,OACE;CACJ;CACA;EACE,KAAK;EACL,OACE;CACJ;CACA;EACE,KAAK;EACL,OACE;CACJ;CACA;EACE,KAAK;EACL,OAAO;CACT;AACF,GAEM,KAAe,MACf,IAAQ,OAAa,GAAG,EAAM,MAC9B,IAAQ,OAAO,OAAa,IAAI,IAAQ,KAAA,CAAM,QAAQ,CAAC,EAAE,OACtD,IAAI,IAAQ,OAAO,KAAA,CAAM,QAAQ,CAAC,EAAE,MAIvC,KAAgB,MA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AAQ,WAAU,UAAW,CAAA;KAAE;KACzE;MAAE,OAAO;MAAU,OAAO;MAAU,MAAM,kBAAC,GAAD,EAAgB,WAAU,UAAW,CAAA;KAAE;KACjF;MAAE,OAAO;MAAW,OAAO;MAAW,MAAM,kBAAC,GAAD,EAAS,WAAU,UAAW,CAAA;KAAE;IAC9E;GACD,CAAA,GACD,kBAAC,OAAD;IAAK,MAAK;IAAW,cAAY,EAAgB,CAAG;cAApD;KACG,MAAQ,YAAY,kBAAC,GAAD,CAAY,CAAA;KAChC,MAAQ,YAAY,kBAAC,GAAD,CAAY,CAAA;KAChC,MAAQ,aAAa,kBAAC,GAAD,CAAa,CAAA;IAChC;KACF;;CACK,CAAA;AAEhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HrisConnectorsCard.d.ts","sourceRoot":"","sources":["../../../../src/buildmyiq/pages/provisioning/HrisConnectorsCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkkBhC,eAAO,MAAM,kBAAkB,EAAE,EAmChC,CAAC"}
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
+
import { formatDateTime as t } from "../../utils/formatters.js";
|
|
3
|
+
import { EmptyState as n } from "../../components/EmptyState.js";
|
|
4
|
+
import "../../components/index.js";
|
|
5
|
+
import { Switch as r } from "../../components/Switch.js";
|
|
6
|
+
import { Field as i, Modal as a, SelectField as o } from "../authoring/_forms.js";
|
|
7
|
+
import { useConnectHris as s, useDeleteHrisConnection as c, useHrisConnections as l, useHrisStatus as u, useSetHrisSchedule as d, useStartHrisSync as f, useUpdateHrisCredentials as p } from "../../hooks/useHrisDirectorySync.js";
|
|
8
|
+
import { HRIS_INTERVAL_OPTIONS as m, HRIS_VENDORS as h, HRIS_VENDOR_ORDER as g, actionTone as _, blockedByMassDeactivation as v, hrisCredentialValues as y, runSummary as b, validateHrisForm as x } from "./hrisModel.js";
|
|
9
|
+
import { useState as S } from "react";
|
|
10
|
+
import { Building2 as C, Eye as w, Play as T, Plus as E, RefreshCw as D, Trash2 as O } from "lucide-react";
|
|
11
|
+
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
12
|
+
import { Button as M, GlassCard as N, Input as P, Textarea as F } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
//#region src/buildmyiq/pages/provisioning/HrisConnectorsCard.tsx
|
|
14
|
+
var I = {
|
|
15
|
+
success: "bg-status-success-bg-subtle text-status-success-text",
|
|
16
|
+
warning: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
17
|
+
error: "bg-status-error-bg-subtle text-status-error-text",
|
|
18
|
+
neutral: "border border-border-seam text-text-primary"
|
|
19
|
+
}, L = {
|
|
20
|
+
created: "New: {{count}}",
|
|
21
|
+
updated: "Updated: {{count}}",
|
|
22
|
+
reactivated: "Reactivated: {{count}}",
|
|
23
|
+
deactivated: "Deactivated: {{count}}",
|
|
24
|
+
unchanged: "Unchanged: {{count}}",
|
|
25
|
+
skipped: "Skipped: {{count}}",
|
|
26
|
+
conflicts: "Conflicts: {{count}}",
|
|
27
|
+
errors: "Errors: {{count}}"
|
|
28
|
+
}, R = {
|
|
29
|
+
CREATE: "Add",
|
|
30
|
+
UPDATE: "Update",
|
|
31
|
+
DEACTIVATE: "Deactivate",
|
|
32
|
+
REACTIVATE: "Reactivate",
|
|
33
|
+
UNCHANGED: "Unchanged",
|
|
34
|
+
SKIP: "Skipped",
|
|
35
|
+
CONFLICT: "Conflict",
|
|
36
|
+
ERROR: "Error"
|
|
37
|
+
}, z = (e, t) => e instanceof Error ? e.message : t, B = ({ vendor: t, connectionId: n, onClose: r }) => {
|
|
38
|
+
let o = e(), c = h[t], l = s(t), u = p(n ?? ""), d = l.isPending || u.isPending, [f, m] = S(c.name), [g, _] = S({}), [v, b] = S(!1), [C, w] = S(null), T = x(t, g), E = Object.keys(T).length > 0 || !n && !f.trim();
|
|
39
|
+
return /* @__PURE__ */ A(a, {
|
|
40
|
+
open: !0,
|
|
41
|
+
onClose: () => {
|
|
42
|
+
d || r();
|
|
43
|
+
},
|
|
44
|
+
title: n ? o("buildmyiq.provisioning.hris.updateTitle", "Update {{name}} credentials", { name: c.name }) : o("buildmyiq.provisioning.hris.connectTitle", "Connect {{name}}", { name: c.name }),
|
|
45
|
+
description: o("buildmyiq.provisioning.hris.connectDescription", "Credentials are encrypted when saved and are never shown again. After saving, preview the sync before running it."),
|
|
46
|
+
footer: /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(M, {
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
onClick: r,
|
|
49
|
+
disabled: d,
|
|
50
|
+
children: o("buildmyiq.provisioning.cancel", "Cancel")
|
|
51
|
+
}), /* @__PURE__ */ A(M, {
|
|
52
|
+
onClick: async () => {
|
|
53
|
+
if (b(!0), !(E || d)) {
|
|
54
|
+
w(null);
|
|
55
|
+
try {
|
|
56
|
+
let e = y(t, g);
|
|
57
|
+
n ? await u.mutateAsync(e) : await l.mutateAsync({
|
|
58
|
+
name: f.trim(),
|
|
59
|
+
values: e
|
|
60
|
+
}), r();
|
|
61
|
+
} catch (e) {
|
|
62
|
+
w(z(e, o("buildmyiq.provisioning.hris.saveError", "Could not save the connection.")));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
disabled: d,
|
|
67
|
+
"data-testid": "hris-save",
|
|
68
|
+
children: d ? o("buildmyiq.provisioning.hris.saving", "Saving…") : o("buildmyiq.provisioning.hris.save", "Save connection")
|
|
69
|
+
})] }),
|
|
70
|
+
children: /* @__PURE__ */ j("div", {
|
|
71
|
+
className: "grid gap-4",
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ A("ol", {
|
|
74
|
+
className: "list-decimal space-y-1 ps-5 text-xs text-text-secondary",
|
|
75
|
+
children: c.steps.map((e) => /* @__PURE__ */ A("li", { children: o(e.key, e.fallback) }, e.key))
|
|
76
|
+
}),
|
|
77
|
+
!n && /* @__PURE__ */ A(i, {
|
|
78
|
+
label: o("buildmyiq.provisioning.hris.field.name", "Connection name"),
|
|
79
|
+
htmlFor: "hris-name",
|
|
80
|
+
required: !0,
|
|
81
|
+
error: v && !f.trim() ? o("buildmyiq.provisioning.hris.required", "Required") : void 0,
|
|
82
|
+
children: /* @__PURE__ */ A(P, {
|
|
83
|
+
id: "hris-name",
|
|
84
|
+
value: f,
|
|
85
|
+
maxLength: 100,
|
|
86
|
+
onChange: (e) => m(e.target.value)
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
89
|
+
c.fields.map((e) => {
|
|
90
|
+
let t = `hris-${e.name}`, n = v ? T[e.name] : void 0;
|
|
91
|
+
return /* @__PURE__ */ A(i, {
|
|
92
|
+
label: o(e.labelKey, e.label),
|
|
93
|
+
htmlFor: t,
|
|
94
|
+
required: !0,
|
|
95
|
+
hint: e.hint && e.hintKey ? o(e.hintKey, e.hint) : void 0,
|
|
96
|
+
error: n === "required" ? o("buildmyiq.provisioning.hris.required", "Required") : n === "https" ? o("buildmyiq.provisioning.hris.httpsError", "{{name}} is only reached over HTTPS. Enter the hostname without http://.", { name: c.name }) : n === "host" ? o("buildmyiq.provisioning.hris.hostError", "Enter a {{name}} hostname, for example {{example}}.", {
|
|
97
|
+
name: c.name,
|
|
98
|
+
example: e.placeholder ?? ""
|
|
99
|
+
}) : void 0,
|
|
100
|
+
children: e.multiline ? /* @__PURE__ */ A(F, {
|
|
101
|
+
id: t,
|
|
102
|
+
rows: 5,
|
|
103
|
+
autoComplete: "off",
|
|
104
|
+
spellCheck: !1,
|
|
105
|
+
className: "font-mono text-xs",
|
|
106
|
+
value: g[e.name] ?? "",
|
|
107
|
+
onChange: (t) => _((n) => ({
|
|
108
|
+
...n,
|
|
109
|
+
[e.name]: t.target.value
|
|
110
|
+
}))
|
|
111
|
+
}) : /* @__PURE__ */ A(P, {
|
|
112
|
+
id: t,
|
|
113
|
+
type: e.secret ? "password" : "text",
|
|
114
|
+
autoComplete: "off",
|
|
115
|
+
placeholder: e.placeholder,
|
|
116
|
+
value: g[e.name] ?? "",
|
|
117
|
+
onChange: (t) => _((n) => ({
|
|
118
|
+
...n,
|
|
119
|
+
[e.name]: t.target.value
|
|
120
|
+
}))
|
|
121
|
+
})
|
|
122
|
+
}, e.name);
|
|
123
|
+
}),
|
|
124
|
+
C && /* @__PURE__ */ A("p", {
|
|
125
|
+
role: "alert",
|
|
126
|
+
className: "text-sm text-status-error-text",
|
|
127
|
+
children: C
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
}, V = 50, H = ({ run: n, title: r }) => {
|
|
133
|
+
let i = e(), a = b(n), o = n.items.slice(0, V);
|
|
134
|
+
return /* @__PURE__ */ j("div", {
|
|
135
|
+
className: "flex flex-col gap-2 rounded-lg border border-border-seam p-3",
|
|
136
|
+
"data-testid": `hris-run-${n.mode.toLowerCase()}`,
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ j("div", {
|
|
139
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
140
|
+
children: [/* @__PURE__ */ A("h4", {
|
|
141
|
+
className: "text-sm font-medium text-text-primary",
|
|
142
|
+
children: r
|
|
143
|
+
}), /* @__PURE__ */ j("span", {
|
|
144
|
+
className: "text-xs text-text-tertiary",
|
|
145
|
+
children: [t(n.finishedAt ?? n.startedAt), n.trigger === "SCHEDULED" ? ` · ${i("buildmyiq.provisioning.hris.scheduled", "scheduled")}` : ""]
|
|
146
|
+
})]
|
|
147
|
+
}),
|
|
148
|
+
n.status === "FAILED" ? /* @__PURE__ */ A("p", {
|
|
149
|
+
role: "alert",
|
|
150
|
+
className: "text-sm text-status-error-text",
|
|
151
|
+
"data-testid": "hris-run-error",
|
|
152
|
+
children: n.errorMessage ?? i("buildmyiq.provisioning.hris.failed", "The sync failed.")
|
|
153
|
+
}) : /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("p", {
|
|
154
|
+
className: "text-xs text-text-secondary",
|
|
155
|
+
children: i("buildmyiq.provisioning.hris.fetched", "{{count}} workers read from the HR system.", { count: n.workersFetched })
|
|
156
|
+
}), /* @__PURE__ */ A("ul", {
|
|
157
|
+
className: "flex flex-wrap gap-2",
|
|
158
|
+
"data-testid": "hris-run-summary",
|
|
159
|
+
children: a.map(({ key: e, count: t }) => /* @__PURE__ */ A("li", {
|
|
160
|
+
className: "rounded-full border border-border-seam px-2.5 py-0.5 text-xs text-text-primary",
|
|
161
|
+
children: i(`buildmyiq.provisioning.hris.count.${e}`, L[e] ?? `${e}: {{count}}`, { count: t })
|
|
162
|
+
}, e))
|
|
163
|
+
})] }),
|
|
164
|
+
o.length > 0 && /* @__PURE__ */ A("div", {
|
|
165
|
+
className: "max-h-64 overflow-auto",
|
|
166
|
+
children: /* @__PURE__ */ j("table", {
|
|
167
|
+
className: "w-full text-start text-xs",
|
|
168
|
+
children: [/* @__PURE__ */ A("thead", {
|
|
169
|
+
className: "text-text-tertiary",
|
|
170
|
+
children: /* @__PURE__ */ j("tr", { children: [
|
|
171
|
+
/* @__PURE__ */ A("th", {
|
|
172
|
+
className: "py-1 pe-2 text-start font-medium",
|
|
173
|
+
children: i("buildmyiq.provisioning.hris.col.worker", "Worker")
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ A("th", {
|
|
176
|
+
className: "py-1 pe-2 text-start font-medium",
|
|
177
|
+
children: i("buildmyiq.provisioning.hris.col.email", "Email")
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ A("th", {
|
|
180
|
+
className: "py-1 pe-2 text-start font-medium",
|
|
181
|
+
children: i("buildmyiq.provisioning.hris.col.outcome", "Outcome")
|
|
182
|
+
})
|
|
183
|
+
] })
|
|
184
|
+
}), /* @__PURE__ */ A("tbody", { children: o.map((e, t) => /* @__PURE__ */ j("tr", {
|
|
185
|
+
className: "border-t border-border-seam align-top",
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ A("td", {
|
|
188
|
+
className: "py-1 pe-2 font-mono text-text-primary",
|
|
189
|
+
children: e.externalId || "—"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ A("td", {
|
|
192
|
+
className: "py-1 pe-2 text-text-secondary",
|
|
193
|
+
children: e.email ?? "—"
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ j("td", {
|
|
196
|
+
className: "py-1 pe-2",
|
|
197
|
+
children: [/* @__PURE__ */ A("span", {
|
|
198
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium ${I[_(e.action)]}`,
|
|
199
|
+
children: i(`buildmyiq.provisioning.hris.action.${e.action}`, R[e.action] ?? e.action)
|
|
200
|
+
}), e.detail && /* @__PURE__ */ A("span", {
|
|
201
|
+
className: "ms-2 text-text-secondary",
|
|
202
|
+
children: e.detail
|
|
203
|
+
})]
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
}, `${e.externalId}-${t}`)) })]
|
|
207
|
+
})
|
|
208
|
+
}),
|
|
209
|
+
n.items.length > o.length && /* @__PURE__ */ A("p", {
|
|
210
|
+
className: "text-xs text-text-tertiary",
|
|
211
|
+
"data-testid": "hris-run-truncated",
|
|
212
|
+
children: i("buildmyiq.provisioning.hris.truncated", "Showing {{shown}} of {{total}} people who need attention.", {
|
|
213
|
+
shown: o.length,
|
|
214
|
+
total: n.items.length
|
|
215
|
+
})
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
});
|
|
219
|
+
}, U = ({ vendor: n, connection: i }) => {
|
|
220
|
+
let a = e(), s = u(i.id), l = f(i.id), p = d(i.id), h = c(n), [g, _] = S(!1), [y, b] = S(!1), [x, C] = S(null), E = s.data, k = !!E?.running || l.isPending, N = async (e, t = !1) => {
|
|
221
|
+
C(null);
|
|
222
|
+
try {
|
|
223
|
+
await l.mutateAsync({
|
|
224
|
+
mode: e,
|
|
225
|
+
allowMassDeactivation: t
|
|
226
|
+
});
|
|
227
|
+
} catch (e) {
|
|
228
|
+
C(z(e, a("buildmyiq.provisioning.hris.startError", "Could not start the sync.")));
|
|
229
|
+
}
|
|
230
|
+
}, P = async (e, t) => {
|
|
231
|
+
C(null);
|
|
232
|
+
try {
|
|
233
|
+
await p.mutateAsync({
|
|
234
|
+
enabled: e,
|
|
235
|
+
intervalHours: t
|
|
236
|
+
});
|
|
237
|
+
} catch (e) {
|
|
238
|
+
C(z(e, a("buildmyiq.provisioning.hris.scheduleError", "Could not change the schedule.")));
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
return /* @__PURE__ */ j("li", {
|
|
242
|
+
className: "flex flex-col gap-3 border-b border-border-seam py-3 last:border-b-0",
|
|
243
|
+
"data-testid": "hris-connection",
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ j("div", {
|
|
246
|
+
className: "flex flex-wrap items-start justify-between gap-2",
|
|
247
|
+
children: [/* @__PURE__ */ j("div", {
|
|
248
|
+
className: "min-w-0",
|
|
249
|
+
children: [/* @__PURE__ */ A("h3", {
|
|
250
|
+
className: "truncate font-medium text-text-primary",
|
|
251
|
+
children: i.name
|
|
252
|
+
}), /* @__PURE__ */ A("p", {
|
|
253
|
+
className: "text-xs text-text-tertiary",
|
|
254
|
+
children: E?.credentialsUpdatedAt ? a("buildmyiq.provisioning.hris.credentialsSaved", "Credentials saved {{date}}", { date: t(E.credentialsUpdatedAt) }) : a("buildmyiq.provisioning.hris.noCredentials", "No credentials saved")
|
|
255
|
+
})]
|
|
256
|
+
}), /* @__PURE__ */ j("div", {
|
|
257
|
+
className: "flex flex-wrap items-center gap-2",
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ j(M, {
|
|
260
|
+
variant: "outline",
|
|
261
|
+
size: "sm",
|
|
262
|
+
onClick: () => N("PREVIEW"),
|
|
263
|
+
disabled: k,
|
|
264
|
+
"data-testid": "hris-preview",
|
|
265
|
+
children: [/* @__PURE__ */ A(w, { className: "me-1.5 h-3.5 w-3.5" }), a("buildmyiq.provisioning.hris.preview", "Preview sync")]
|
|
266
|
+
}),
|
|
267
|
+
/* @__PURE__ */ j(M, {
|
|
268
|
+
size: "sm",
|
|
269
|
+
onClick: () => N("APPLY"),
|
|
270
|
+
disabled: k || !E?.canApply,
|
|
271
|
+
"data-testid": "hris-apply",
|
|
272
|
+
children: [/* @__PURE__ */ A(T, { className: "me-1.5 h-3.5 w-3.5" }), a("buildmyiq.provisioning.hris.apply", "Sync now")]
|
|
273
|
+
}),
|
|
274
|
+
/* @__PURE__ */ j(M, {
|
|
275
|
+
variant: "ghost",
|
|
276
|
+
size: "sm",
|
|
277
|
+
onClick: () => _(!0),
|
|
278
|
+
children: [/* @__PURE__ */ A(D, { className: "me-1.5 h-3.5 w-3.5" }), a("buildmyiq.provisioning.hris.updateCredentials", "Update credentials")]
|
|
279
|
+
}),
|
|
280
|
+
y ? /* @__PURE__ */ A(M, {
|
|
281
|
+
variant: "destructive",
|
|
282
|
+
size: "sm",
|
|
283
|
+
disabled: h.isPending,
|
|
284
|
+
onClick: () => h.mutateAsync(i.id).catch((e) => C(z(e, a("buildmyiq.provisioning.hris.deleteError", "Could not remove the connection.")))),
|
|
285
|
+
children: a("buildmyiq.provisioning.hris.confirmDelete", "Remove connection")
|
|
286
|
+
}) : /* @__PURE__ */ A(M, {
|
|
287
|
+
variant: "ghost",
|
|
288
|
+
size: "sm",
|
|
289
|
+
onClick: () => b(!0),
|
|
290
|
+
"aria-label": a("buildmyiq.provisioning.hris.delete", "Remove"),
|
|
291
|
+
children: /* @__PURE__ */ A(O, { className: "h-3.5 w-3.5" })
|
|
292
|
+
})
|
|
293
|
+
]
|
|
294
|
+
})]
|
|
295
|
+
}),
|
|
296
|
+
E && !E.canApply && !k && /* @__PURE__ */ A("p", {
|
|
297
|
+
className: "text-xs text-text-secondary",
|
|
298
|
+
"data-testid": "hris-preview-first",
|
|
299
|
+
children: a("buildmyiq.provisioning.hris.previewFirst", "Preview the sync first. Nothing changes in the workspace until you run a sync after a successful preview.")
|
|
300
|
+
}),
|
|
301
|
+
k && /* @__PURE__ */ A("p", {
|
|
302
|
+
className: "text-xs text-text-secondary",
|
|
303
|
+
role: "status",
|
|
304
|
+
"data-testid": "hris-running",
|
|
305
|
+
children: a("buildmyiq.provisioning.hris.running", "Reading workers from the HR system…")
|
|
306
|
+
}),
|
|
307
|
+
E && /* @__PURE__ */ j("div", {
|
|
308
|
+
className: "flex flex-wrap items-center gap-3",
|
|
309
|
+
children: [
|
|
310
|
+
/* @__PURE__ */ j("label", {
|
|
311
|
+
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
312
|
+
htmlFor: `hris-schedule-${i.id}`,
|
|
313
|
+
children: [/* @__PURE__ */ A(r, {
|
|
314
|
+
id: `hris-schedule-${i.id}`,
|
|
315
|
+
checked: E.scheduleEnabled,
|
|
316
|
+
disabled: p.isPending || !E.scheduleEnabled && !E.canApply,
|
|
317
|
+
onCheckedChange: (e) => void P(e, E.intervalHours)
|
|
318
|
+
}), a("buildmyiq.provisioning.hris.schedule", "Sync automatically")]
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ A("div", {
|
|
321
|
+
className: "w-40",
|
|
322
|
+
children: /* @__PURE__ */ A(o, {
|
|
323
|
+
id: `hris-interval-${i.id}`,
|
|
324
|
+
"aria-label": a("buildmyiq.provisioning.hris.interval", "Sync interval"),
|
|
325
|
+
value: String(E.intervalHours),
|
|
326
|
+
disabled: p.isPending || !E.scheduleEnabled,
|
|
327
|
+
onChange: (e) => void P(E.scheduleEnabled, Number(e)),
|
|
328
|
+
options: m.map((e) => ({
|
|
329
|
+
value: String(e),
|
|
330
|
+
label: e === 168 ? a("buildmyiq.provisioning.hris.weekly", "Weekly") : a("buildmyiq.provisioning.hris.everyHours", "Every {{hours}} hours", { hours: e })
|
|
331
|
+
}))
|
|
332
|
+
})
|
|
333
|
+
}),
|
|
334
|
+
E.scheduleEnabled && E.nextRunAt && /* @__PURE__ */ A("span", {
|
|
335
|
+
className: "text-xs text-text-tertiary",
|
|
336
|
+
children: a("buildmyiq.provisioning.hris.nextRun", "Next sync {{date}}", { date: t(E.nextRunAt) })
|
|
337
|
+
})
|
|
338
|
+
]
|
|
339
|
+
}),
|
|
340
|
+
E?.lastPreview && /* @__PURE__ */ A(H, {
|
|
341
|
+
run: E.lastPreview,
|
|
342
|
+
title: a("buildmyiq.provisioning.hris.lastPreview", "Last preview")
|
|
343
|
+
}),
|
|
344
|
+
E?.lastApply && /* @__PURE__ */ A(H, {
|
|
345
|
+
run: E.lastApply,
|
|
346
|
+
title: a("buildmyiq.provisioning.hris.lastApply", "Last sync")
|
|
347
|
+
}),
|
|
348
|
+
v(E?.lastApply ?? null) && !k && /* @__PURE__ */ A("div", {
|
|
349
|
+
className: "flex flex-wrap items-center gap-2",
|
|
350
|
+
children: /* @__PURE__ */ A(M, {
|
|
351
|
+
variant: "destructive",
|
|
352
|
+
size: "sm",
|
|
353
|
+
onClick: () => N("APPLY", !0),
|
|
354
|
+
children: a("buildmyiq.provisioning.hris.allowMass", "Sync anyway and deactivate them")
|
|
355
|
+
})
|
|
356
|
+
}),
|
|
357
|
+
!!(x || s.error) && /* @__PURE__ */ A("p", {
|
|
358
|
+
role: "alert",
|
|
359
|
+
className: "text-xs text-status-error-text",
|
|
360
|
+
children: x ?? z(s.error, a("buildmyiq.provisioning.hris.loadError", "Could not load the sync status."))
|
|
361
|
+
}),
|
|
362
|
+
g && /* @__PURE__ */ A(B, {
|
|
363
|
+
vendor: n,
|
|
364
|
+
connectionId: i.id,
|
|
365
|
+
onClose: () => _(!1)
|
|
366
|
+
})
|
|
367
|
+
]
|
|
368
|
+
});
|
|
369
|
+
}, W = ({ vendor: t }) => {
|
|
370
|
+
let n = e(), r = h[t], i = l(t), [a, o] = S(!1);
|
|
371
|
+
return i.data === null ? null : /* @__PURE__ */ j("section", {
|
|
372
|
+
className: "flex flex-col gap-2",
|
|
373
|
+
"data-testid": `hris-vendor-${t}`,
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ j("div", {
|
|
376
|
+
className: "flex flex-wrap items-start justify-between gap-2",
|
|
377
|
+
children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("h3", {
|
|
378
|
+
className: "font-medium text-text-primary",
|
|
379
|
+
children: r.name
|
|
380
|
+
}), /* @__PURE__ */ A("p", {
|
|
381
|
+
className: "text-xs text-text-secondary",
|
|
382
|
+
children: n(r.descriptionKey, r.description)
|
|
383
|
+
})] }), /* @__PURE__ */ j(M, {
|
|
384
|
+
variant: "outline",
|
|
385
|
+
size: "sm",
|
|
386
|
+
onClick: () => o(!0),
|
|
387
|
+
"data-testid": `hris-connect-${t}`,
|
|
388
|
+
children: [/* @__PURE__ */ A(E, { className: "me-1.5 h-3.5 w-3.5" }), n("buildmyiq.provisioning.hris.connect", "Connect {{name}}", { name: r.name })]
|
|
389
|
+
})]
|
|
390
|
+
}),
|
|
391
|
+
i.isError && /* @__PURE__ */ A("p", {
|
|
392
|
+
role: "alert",
|
|
393
|
+
className: "text-xs text-status-error-text",
|
|
394
|
+
children: z(i.error, n("buildmyiq.provisioning.hris.loadError", "Could not load the sync status."))
|
|
395
|
+
}),
|
|
396
|
+
i.data && i.data.length > 0 && /* @__PURE__ */ A("ul", { children: i.data.map((e) => /* @__PURE__ */ A(U, {
|
|
397
|
+
vendor: t,
|
|
398
|
+
connection: e
|
|
399
|
+
}, e.id)) }),
|
|
400
|
+
a && /* @__PURE__ */ A(B, {
|
|
401
|
+
vendor: t,
|
|
402
|
+
onClose: () => o(!1)
|
|
403
|
+
})
|
|
404
|
+
]
|
|
405
|
+
});
|
|
406
|
+
}, G = () => {
|
|
407
|
+
let t = e(), r = l("workday"), i = l("sap-successfactors"), a = r.data === null && i.data === null;
|
|
408
|
+
return /* @__PURE__ */ j(N, {
|
|
409
|
+
treatment: "plain",
|
|
410
|
+
className: "flex flex-col gap-4 p-4",
|
|
411
|
+
"data-testid": "hris-connectors",
|
|
412
|
+
children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("h2", {
|
|
413
|
+
className: "font-semibold text-text-primary",
|
|
414
|
+
children: t("buildmyiq.provisioning.hris.title", "Direct HR system connectors")
|
|
415
|
+
}), /* @__PURE__ */ A("p", {
|
|
416
|
+
className: "text-sm text-text-secondary",
|
|
417
|
+
children: t("buildmyiq.provisioning.hris.description", "No Okta or Entra ID tenant? Connect Workday or SAP SuccessFactors directly. Hires are added, changes are applied and leavers are deactivated, exactly as SCIM provisioning would.")
|
|
418
|
+
})] }), a ? /* @__PURE__ */ A(n, {
|
|
419
|
+
icon: /* @__PURE__ */ A(C, { className: "h-8 w-8" }),
|
|
420
|
+
title: t("buildmyiq.provisioning.hris.unavailableTitle", "HR connectors are not available"),
|
|
421
|
+
description: t("buildmyiq.provisioning.hris.unavailable", "The Workday and SAP SuccessFactors connectors are not enabled for this workspace yet.")
|
|
422
|
+
}) : g.map((e) => /* @__PURE__ */ A(W, { vendor: e }, e))]
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
//#endregion
|
|
426
|
+
export { G as HrisConnectorsCard };
|
|
427
|
+
|
|
428
|
+
//# sourceMappingURL=HrisConnectorsCard.js.map
|