cloud-ide-academics 0.0.54 → 0.0.56

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.
Files changed (30) hide show
  1. package/fesm2022/{cloud-ide-academics-bonafide-request-detail.component-BRG6AkHZ.mjs → cloud-ide-academics-bonafide-request-detail.component-Mh9qdY6v.mjs} +6 -6
  2. package/fesm2022/cloud-ide-academics-bonafide-request-detail.component-Mh9qdY6v.mjs.map +1 -0
  3. package/fesm2022/cloud-ide-academics-bonafide-request-form.component-GiVehOPg.mjs +317 -0
  4. package/fesm2022/cloud-ide-academics-bonafide-request-form.component-GiVehOPg.mjs.map +1 -0
  5. package/fesm2022/{cloud-ide-academics-bonafide-request-list.component-DKYKgplL.mjs → cloud-ide-academics-bonafide-request-list.component-CldJcpVL.mjs} +7 -7
  6. package/fesm2022/cloud-ide-academics-bonafide-request-list.component-CldJcpVL.mjs.map +1 -0
  7. package/fesm2022/{cloud-ide-academics-bonafide.service-DB6ySuGe.mjs → cloud-ide-academics-bonafide.service-CHPe3MPl.mjs} +4 -4
  8. package/fesm2022/{cloud-ide-academics-bonafide.service-DB6ySuGe.mjs.map → cloud-ide-academics-bonafide.service-CHPe3MPl.mjs.map} +1 -1
  9. package/fesm2022/{cloud-ide-academics-class-program-term-create.component-1IuTrJUo.mjs → cloud-ide-academics-class-program-term-create.component-B-gGKnpJ.mjs} +9 -6
  10. package/fesm2022/cloud-ide-academics-class-program-term-create.component-B-gGKnpJ.mjs.map +1 -0
  11. package/fesm2022/{cloud-ide-academics-class-program-term-list.component-C1JWoKus.mjs → cloud-ide-academics-class-program-term-list.component-BFfAhZrq.mjs} +9 -8
  12. package/fesm2022/cloud-ide-academics-class-program-term-list.component-BFfAhZrq.mjs.map +1 -0
  13. package/fesm2022/{cloud-ide-academics-cloud-ide-academics-Dd-B1hBe.mjs → cloud-ide-academics-cloud-ide-academics-BVQ8sA0L.mjs} +404 -116
  14. package/fesm2022/cloud-ide-academics-cloud-ide-academics-BVQ8sA0L.mjs.map +1 -0
  15. package/fesm2022/{cloud-ide-academics-program-class-create.component-DT_-sBiQ.mjs → cloud-ide-academics-program-class-create.component-DIG3K1WR.mjs} +53 -26
  16. package/fesm2022/cloud-ide-academics-program-class-create.component-DIG3K1WR.mjs.map +1 -0
  17. package/fesm2022/{cloud-ide-academics-program-class-list.component-CaVWRJfR.mjs → cloud-ide-academics-program-class-list.component-DZrSl_02.mjs} +188 -28
  18. package/fesm2022/cloud-ide-academics-program-class-list.component-DZrSl_02.mjs.map +1 -0
  19. package/fesm2022/cloud-ide-academics.mjs +1 -1
  20. package/index.d.ts +40 -0
  21. package/package.json +1 -1
  22. package/fesm2022/cloud-ide-academics-bonafide-request-detail.component-BRG6AkHZ.mjs.map +0 -1
  23. package/fesm2022/cloud-ide-academics-bonafide-request-form.component-CM3ISuhU.mjs +0 -317
  24. package/fesm2022/cloud-ide-academics-bonafide-request-form.component-CM3ISuhU.mjs.map +0 -1
  25. package/fesm2022/cloud-ide-academics-bonafide-request-list.component-DKYKgplL.mjs.map +0 -1
  26. package/fesm2022/cloud-ide-academics-class-program-term-create.component-1IuTrJUo.mjs.map +0 -1
  27. package/fesm2022/cloud-ide-academics-class-program-term-list.component-C1JWoKus.mjs.map +0 -1
  28. package/fesm2022/cloud-ide-academics-cloud-ide-academics-Dd-B1hBe.mjs.map +0 -1
  29. package/fesm2022/cloud-ide-academics-program-class-create.component-DT_-sBiQ.mjs.map +0 -1
  30. package/fesm2022/cloud-ide-academics-program-class-list.component-CaVWRJfR.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloud-ide-academics-bonafide-request-detail.component-BRG6AkHZ.mjs","sources":["../../../projects/cloud-ide-academics/src/lib/collection/bonafide/components/bonafide-request-detail/bonafide-request-detail.component.ts","../../../projects/cloud-ide-academics/src/lib/collection/bonafide/components/bonafide-request-detail/bonafide-request-detail.component.html"],"sourcesContent":["import { Component, signal, DestroyRef, inject, computed, OnInit, effect } from '@angular/core';\r\nimport { CommonModule, DatePipe } from '@angular/common';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { CideEleButtonComponent, CideIconComponent, NotificationService } from 'cloud-ide-element';\r\nimport { RightsService, CideLytSharedService, CideLytSharedWrapperComponent } from 'cloud-ide-layout';\r\nimport { CideAcademicsBonafideService } from '../../services/bonafide.service';\r\nimport { generateObjectFromString } from 'cloud-ide-lms-model';\r\n\r\n@Component({\r\n selector: 'cide-academics-bonafide-request-detail',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n DatePipe,\r\n CideEleButtonComponent,\r\n CideIconComponent,\r\n CideLytSharedWrapperComponent\r\n ],\r\n templateUrl: './bonafide-request-detail.component.html',\r\n styles: [`\r\n :host {\r\n @apply tw-w-full tw-h-full tw-flex tw-flex-col;\r\n }\r\n `]\r\n})\r\nexport class CideAcademicsBonafideRequestDetailComponent implements OnInit {\r\n private destroyRef = inject(DestroyRef);\r\n private bonafideService = inject(CideAcademicsBonafideService);\r\n private router = inject(Router);\r\n private route = inject(ActivatedRoute);\r\n private rightsService = inject(RightsService);\r\n private sharedService = inject(CideLytSharedService);\r\n private notificationService = inject(NotificationService);\r\n\r\n request = signal<any>(null);\r\n history = signal<any[]>([]);\r\n loading = signal(false);\r\n loadingHistory = signal(false);\r\n error = signal<string | null>(null);\r\n \r\n // Page config\r\n pageTitle = signal<string>('');\r\n pageSubtitle = signal<string>('');\r\n pageCode = signal<string>('academics_bonafide_detail');\r\n \r\n canView = computed(() => this.rightsService.hasRight('VIEW'));\r\n canDownload = computed(() => this.rightsService.hasRight('DOWNLOAD'));\r\n\r\n hasSoftCopy = computed(() => {\r\n const req = this.request();\r\n return !!(req?.abnr_soft_copy_id_cyfm);\r\n });\r\n\r\n hasStampedCopy = computed(() => {\r\n const req = this.request();\r\n return !!(req?.abnr_stamped_copy_id_cyfm);\r\n });\r\n\r\n constructor() {\r\n // Watch for page data changes\r\n effect(() => {\r\n const currentPageCode = this.pageCode();\r\n if (!currentPageCode) return;\r\n\r\n const pageDataCache = this.sharedService.pageDataStore();\r\n const cachedData = pageDataCache[currentPageCode];\r\n const page = cachedData?.data?.page;\r\n \r\n if (page) {\r\n const cfgString = page?.sypg_configuration;\r\n if (cfgString) {\r\n try {\r\n const cfg = JSON.parse(cfgString);\r\n this.pageTitle.set(cfg.title || page?.sypg_title || '');\r\n this.pageSubtitle.set(cfg.subTitle || page?.sypg_desc || '');\r\n } catch (e) {\r\n console.warn('Invalid page config JSON', e);\r\n this.pageTitle.set(page?.sypg_title || '');\r\n this.pageSubtitle.set(page?.sypg_desc || '');\r\n }\r\n } else {\r\n this.pageTitle.set(page?.sypg_title || '');\r\n this.pageSubtitle.set(page?.sypg_desc || '');\r\n }\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n // Initialize rights\r\n this.rightsService.initializeRights('academics_bonafide_detail');\r\n\r\n // Get request ID from route\r\n this.route.params.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(params => {\r\n const query = params['query'];\r\n if (query) {\r\n const queryObj = generateObjectFromString(query);\r\n const requestId = queryObj.abnr_id || queryObj._id;\r\n if (requestId) {\r\n this.loadRequest(requestId);\r\n this.loadHistory(requestId);\r\n } else {\r\n this.error.set('Request ID not found in route');\r\n }\r\n }\r\n });\r\n }\r\n\r\n loadRequest(requestId: string): void {\r\n this.loading.set(true);\r\n this.error.set(null);\r\n\r\n this.bonafideService.getRequestById(requestId)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (response) => {\r\n if (response.success) {\r\n this.request.set(response.data);\r\n } else {\r\n this.error.set(response.message || 'Failed to load request');\r\n }\r\n this.loading.set(false);\r\n },\r\n error: (err) => {\r\n console.error('Error loading request:', err);\r\n this.error.set(err.message || 'Failed to load request');\r\n this.loading.set(false);\r\n }\r\n });\r\n }\r\n\r\n loadHistory(requestId: string): void {\r\n this.loadingHistory.set(true);\r\n\r\n this.bonafideService.getHistory(requestId)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (response) => {\r\n if (response.success) {\r\n this.history.set(Array.isArray(response.data) ? response.data : []);\r\n }\r\n this.loadingHistory.set(false);\r\n },\r\n error: (err) => {\r\n console.error('Error loading history:', err);\r\n this.history.set([]);\r\n this.loadingHistory.set(false);\r\n }\r\n });\r\n }\r\n\r\n getStatusText(): string {\r\n const req = this.request();\r\n if (!req) return 'N/A';\r\n const status = req.abnr_status_id_sygms;\r\n if (!status) return 'N/A';\r\n if (typeof status === 'string') return status;\r\n return status.sygms_title || status.sygms_code || 'N/A';\r\n }\r\n\r\n getStatusBadgeClass(): string {\r\n const statusText = this.getStatusText().toUpperCase();\r\n if (statusText.includes('PENDING')) {\r\n return 'tw-inline-flex tw-items-center tw-px-3 tw-py-1 tw-rounded-full tw-text-sm tw-font-medium tw-bg-yellow-100 tw-text-yellow-800 dark:tw-bg-yellow-900/30 dark:tw-text-yellow-300';\r\n } else if (statusText.includes('REVIEW')) {\r\n return 'tw-inline-flex tw-items-center tw-px-3 tw-py-1 tw-rounded-full tw-text-sm tw-font-medium tw-bg-blue-100 tw-text-blue-800 dark:tw-bg-blue-900/30 dark:tw-text-blue-300';\r\n } else if (statusText.includes('APPROVED')) {\r\n return 'tw-inline-flex tw-items-center tw-px-3 tw-py-1 tw-rounded-full tw-text-sm tw-font-medium tw-bg-green-100 tw-text-green-800 dark:tw-bg-green-900/30 dark:tw-text-green-300';\r\n } else if (statusText.includes('COMPLETED')) {\r\n return 'tw-inline-flex tw-items-center tw-px-3 tw-py-1 tw-rounded-full tw-text-sm tw-font-medium tw-bg-emerald-100 tw-text-emerald-800 dark:tw-bg-emerald-900/30 dark:tw-text-emerald-300';\r\n } else if (statusText.includes('REJECTED')) {\r\n return 'tw-inline-flex tw-items-center tw-px-3 tw-py-1 tw-rounded-full tw-text-sm tw-font-medium tw-bg-red-100 tw-text-red-800 dark:tw-bg-red-900/30 dark:tw-text-red-300';\r\n }\r\n return 'tw-inline-flex tw-items-center tw-px-3 tw-py-1 tw-rounded-full tw-text-sm tw-font-medium tw-bg-gray-100 tw-text-gray-800 dark:tw-bg-gray-700 dark:tw-text-gray-300';\r\n }\r\n\r\n getStudentName(): string {\r\n const req = this.request();\r\n if (!req) return 'N/A';\r\n const student = req.abnr_student_id_auth;\r\n if (!student) return 'N/A';\r\n if (typeof student === 'string') return student;\r\n return student.user_fullname || student.user_username || 'N/A';\r\n }\r\n\r\n downloadCertificate(fileType: 'soft-copy' | 'stamped-copy'): void {\r\n const req = this.request();\r\n if (!req || !req._id) {\r\n this.notificationService.error('Request ID not found');\r\n return;\r\n }\r\n\r\n try {\r\n this.bonafideService.downloadCertificate(req._id, fileType);\r\n this.notificationService.success(`Downloading ${fileType === 'soft-copy' ? 'soft copy' : 'stamped copy'}...`);\r\n } catch (error: any) {\r\n console.error('Error downloading certificate:', error);\r\n this.notificationService.error('Failed to download certificate');\r\n }\r\n }\r\n\r\n viewCertificate(): void {\r\n const req = this.request();\r\n if (!req || !req._id) {\r\n this.notificationService.error('Request ID not found');\r\n return;\r\n }\r\n\r\n if (!this.hasSoftCopy()) {\r\n this.notificationService.error('Soft copy not available');\r\n return;\r\n }\r\n\r\n // Open in new window for viewing/printing\r\n const url = this.bonafideService.getDownloadUrl(req._id, 'soft-copy');\r\n window.open(url, '_blank');\r\n }\r\n\r\n goBack(): void {\r\n this.router.navigate(['/control-panel/bonafide']);\r\n }\r\n}\r\n","<!-- Bonafide Request Detail with Shared Wrapper -->\r\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'academics_bonafide_detail' }\">\r\n <div class=\"tw-w-full tw-h-full tw-flex tw-flex-col tw-bg-gray-50\">\r\n \r\n @if (loading()) {\r\n <!-- Loading State -->\r\n <div class=\"tw-flex tw-items-center tw-justify-center tw-h-full\">\r\n <div class=\"tw-text-center\">\r\n <cide-ele-icon class=\"tw-text-6xl tw-text-gray-300 dark:tw-text-gray-600 tw-animate-spin\">refresh</cide-ele-icon>\r\n <p class=\"tw-text-sm tw-text-gray-500 dark:tw-text-gray-400 tw-mt-4\">Loading request details...</p>\r\n </div>\r\n </div>\r\n } @else if (error()) {\r\n <!-- Error State -->\r\n <div class=\"tw-flex tw-items-center tw-justify-center tw-h-full\">\r\n <div class=\"tw-text-center tw-max-w-md\">\r\n <cide-ele-icon class=\"tw-text-6xl tw-text-red-300 dark:tw-text-red-600\">error</cide-ele-icon>\r\n <h3 class=\"tw-text-lg tw-font-semibold tw-text-gray-900 dark:tw-text-gray-100 tw-mt-4\">Error</h3>\r\n <p class=\"tw-text-sm tw-text-gray-600 dark:tw-text-gray-400 tw-mt-2\">{{ error() }}</p>\r\n <button cideEleButton variant=\"primary\" size=\"sm\" (click)=\"goBack()\" class=\"tw-mt-4\">\r\n Back to List\r\n </button>\r\n </div>\r\n </div>\r\n } @else if (request()) {\r\n @if (request(); as req) {\r\n <!-- Header Section -->\r\n <div class=\"tw-bg-white tw-border-b tw-border-gray-200 tw-px-6 tw-py-4\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between\">\r\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\r\n <cide-ele-icon class=\"tw-text-blue-600\">description</cide-ele-icon>\r\n <div>\r\n <h2 class=\"tw-text-xl tw-font-semibold tw-text-gray-900\">\r\n {{ req.abnr_request_number || 'Bonafide Request' }}\r\n </h2>\r\n <p class=\"tw-text-sm tw-text-gray-600\">\r\n {{ pageSubtitle() || 'Request details and workflow history' }}\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\r\n <span [class]=\"getStatusBadgeClass()\">\r\n {{ getStatusText() }}\r\n </span>\r\n <button cideEleButton variant=\"ghost\" size=\"sm\" leftIcon=\"arrow_back\" (click)=\"goBack()\">\r\n Back\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Main Content -->\r\n <div class=\"tw-flex-1 tw-overflow-auto tw-p-6\">\r\n <div class=\"tw-grid tw-grid-cols-1 lg:tw-grid-cols-2 tw-gap-6\">\r\n \r\n <!-- Request Information Card -->\r\n <div class=\"tw-bg-white tw-rounded-lg tw-shadow tw-p-6\">\r\n <h3 class=\"tw-text-lg tw-font-semibold tw-text-gray-900 tw-mb-4 tw-flex tw-items-center tw-gap-2\">\r\n <cide-ele-icon class=\"tw-text-blue-500\">info</cide-ele-icon>\r\n Request Information\r\n </h3>\r\n <div class=\"tw-space-y-4\">\r\n <div>\r\n <label class=\"tw-text-xs tw-font-medium tw-text-gray-500 tw-uppercase tw-tracking-wide\">Request Number</label>\r\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-mt-1\">{{ req.abnr_request_number || 'N/A' }}</p>\r\n </div>\r\n <div>\r\n <label class=\"tw-text-xs tw-font-medium tw-text-gray-500 tw-uppercase tw-tracking-wide\">Purpose</label>\r\n <p class=\"tw-text-sm tw-text-gray-900 tw-mt-1\">{{ req.abnr_purpose || 'N/A' }}</p>\r\n </div>\r\n <div>\r\n <label class=\"tw-text-xs tw-font-medium tw-text-gray-500 tw-uppercase tw-tracking-wide\">Request Date</label>\r\n <p class=\"tw-text-sm tw-text-gray-900 tw-mt-1\">{{ req.abnr_request_date | date:'MMM dd, yyyy' }}</p>\r\n </div>\r\n @if (req.abnr_completed_date) {\r\n <div>\r\n <label class=\"tw-text-xs tw-font-medium tw-text-gray-500 tw-uppercase tw-tracking-wide\">Completed Date</label>\r\n <p class=\"tw-text-sm tw-text-gray-900 tw-mt-1\">{{ req.abnr_completed_date | date:'MMM dd, yyyy' }}</p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Student Information Card -->\r\n <div class=\"tw-bg-white tw-rounded-lg tw-shadow tw-p-6\">\r\n <h3 class=\"tw-text-lg tw-font-semibold tw-text-gray-900 tw-mb-4 tw-flex tw-items-center tw-gap-2\">\r\n <cide-ele-icon class=\"tw-text-purple-500\">person</cide-ele-icon>\r\n Student Information\r\n </h3>\r\n <div class=\"tw-space-y-4\">\r\n <div>\r\n <label class=\"tw-text-xs tw-font-medium tw-text-gray-500 tw-uppercase tw-tracking-wide\">Student Name</label>\r\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900 tw-mt-1\">{{ getStudentName() }}</p>\r\n </div>\r\n @if (req.abnr_student_id) {\r\n <div>\r\n <label class=\"tw-text-xs tw-font-medium tw-text-gray-500 tw-uppercase tw-tracking-wide\">Student ID</label>\r\n <p class=\"tw-text-sm tw-text-gray-900 tw-mt-1\">{{ req.abnr_student_id }}</p>\r\n </div>\r\n }\r\n @if (req.abnr_student_id_auth?.user_emailid) {\r\n <div>\r\n <label class=\"tw-text-xs tw-font-medium tw-text-gray-500 tw-uppercase tw-tracking-wide\">Email</label>\r\n <p class=\"tw-text-sm tw-text-gray-900 tw-mt-1\">{{ req.abnr_student_id_auth.user_emailid }}</p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- File Downloads Card -->\r\n @if (canDownload() && (hasSoftCopy() || hasStampedCopy())) {\r\n <div class=\"tw-bg-white tw-rounded-lg tw-shadow tw-p-6\">\r\n <h3 class=\"tw-text-lg tw-font-semibold tw-text-gray-900 tw-mb-4 tw-flex tw-items-center tw-gap-2\">\r\n <cide-ele-icon class=\"tw-text-green-500\">download</cide-ele-icon>\r\n Certificate Downloads\r\n </h3>\r\n <div class=\"tw-space-y-3\">\r\n @if (hasSoftCopy()) {\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-p-3 tw-bg-gray-50 tw-rounded-lg\">\r\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\r\n <cide-ele-icon class=\"tw-text-blue-500\">description</cide-ele-icon>\r\n <div>\r\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900\">Soft Copy Certificate</p>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Generated certificate (HTML/PDF)</p>\r\n </div>\r\n </div>\r\n <div class=\"tw-flex tw-items-center tw-space-x-2\">\r\n <button cideEleButton variant=\"ghost\" size=\"sm\" leftIcon=\"visibility\" (click)=\"viewCertificate()\">\r\n View\r\n </button>\r\n <button cideEleButton variant=\"primary\" size=\"sm\" leftIcon=\"download\" (click)=\"downloadCertificate('soft-copy')\">\r\n Download\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n @if (hasStampedCopy()) {\r\n <div class=\"tw-flex tw-items-center tw-justify-between tw-p-3 tw-bg-gray-50 tw-rounded-lg\">\r\n <div class=\"tw-flex tw-items-center tw-space-x-3\">\r\n <cide-ele-icon class=\"tw-text-green-500\">stamp</cide-ele-icon>\r\n <div>\r\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900\">Stamped Copy</p>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Physical stamped certificate scan</p>\r\n </div>\r\n </div>\r\n <button cideEleButton variant=\"primary\" size=\"sm\" leftIcon=\"download\" (click)=\"downloadCertificate('stamped-copy')\">\r\n Download\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Workflow History Card -->\r\n <div class=\"tw-bg-white tw-rounded-lg tw-shadow tw-p-6 lg:tw-col-span-2\">\r\n <h3 class=\"tw-text-lg tw-font-semibold tw-text-gray-900 tw-mb-4 tw-flex tw-items-center tw-gap-2\">\r\n <cide-ele-icon class=\"tw-text-orange-500\">history</cide-ele-icon>\r\n Workflow History\r\n </h3>\r\n @if (loadingHistory()) {\r\n <div class=\"tw-text-center tw-py-8\">\r\n <cide-ele-icon class=\"tw-text-4xl tw-text-gray-300 tw-animate-spin\">refresh</cide-ele-icon>\r\n <p class=\"tw-text-sm tw-text-gray-500 tw-mt-2\">Loading history...</p>\r\n </div>\r\n } @else if (history().length === 0) {\r\n <div class=\"tw-text-center tw-py-8\">\r\n <cide-ele-icon class=\"tw-text-4xl tw-text-gray-300\">history</cide-ele-icon>\r\n <p class=\"tw-text-sm tw-text-gray-500 tw-mt-2\">No workflow history available</p>\r\n </div>\r\n } @else {\r\n <div class=\"tw-space-y-4\">\r\n @for (item of history(); track item._id || $index) {\r\n <div class=\"tw-flex tw-items-start tw-space-x-4 tw-p-4 tw-border-l-4 tw-border-blue-500 tw-bg-gray-50 tw-rounded-r-lg\">\r\n <cide-ele-icon class=\"tw-text-blue-500 tw-mt-1\">circle</cide-ele-icon>\r\n <div class=\"tw-flex-1\">\r\n <div class=\"tw-flex tw-items-center tw-justify-between\">\r\n <p class=\"tw-text-sm tw-font-medium tw-text-gray-900\">{{ item.action_type || 'Action' }}</p>\r\n @if (item.action_date) {\r\n <p class=\"tw-text-xs tw-text-gray-500\">{{ item.action_date | date:'MMM dd, yyyy HH:mm' }}</p>\r\n }\r\n </div>\r\n @if (item.comments) {\r\n <p class=\"tw-text-xs tw-text-gray-600 tw-mt-1\">{{ item.comments }}</p>\r\n }\r\n @if (item.action_by) {\r\n <p class=\"tw-text-xs tw-text-gray-500 tw-mt-1\">By: {{ item.action_by }}</p>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</cide-lyt-shared-wrapper>\r\n"],"names":[],"mappings":";;;;;;;;;;;MA0Ba,2CAA2C,CAAA;AAC9C,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,eAAe,GAAG,MAAM,CAAC,4BAA4B,CAAC;AACtD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AACrC,IAAA,aAAa,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC5C,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAEzD,IAAA,OAAO,GAAG,MAAM,CAAM,IAAI,mDAAC;AAC3B,IAAA,OAAO,GAAG,MAAM,CAAQ,EAAE,mDAAC;AAC3B,IAAA,OAAO,GAAG,MAAM,CAAC,K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,EAAA,YAAA,EAAA,cAAA,EAAA,oBAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACtB,iBAAiB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACjB,6BAA6B,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,CAAA,4BAAA,EAAA,iBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA;;2FASpB,2CAA2C,EAAA,UAAA,EAAA,CAAA;kBAjBvD,SAAS;+BACE,wCAAwC,EAAA,UAAA,EACtC,IAAI,EAAA,OAAA,EACP;wBACP,YAAY;wBACZ,QAAQ;wBACR,sBAAsB;wBACtB,iBAAiB;wBACjB;AACD,qBAAA,EAAA,QAAA,EAAA,qiWAAA,EAAA,MAAA,EAAA,CAAA,0DAAA,CAAA,EAAA;;;;;"}
@@ -1,317 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DestroyRef, signal, computed, Component } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import * as i1 from '@angular/forms';
5
- import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
6
- import { Router } from '@angular/router';
7
- import { HttpClient } from '@angular/common/http';
8
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
9
- import { NotificationService, CideInputComponent, CideTextareaComponent, CideEleButtonComponent, CideFormFieldErrorComponent, CideSelectComponent } from 'cloud-ide-element';
10
- import { AppStateHelperService, CideLytSharedWrapperComponent } from 'cloud-ide-layout';
11
- import { C as CideAcademicsBonafideService } from './cloud-ide-academics-bonafide.service-DB6ySuGe.mjs';
12
- import { generateStringFromObject, cidePath, hostManagerRoutesUrl, coreRoutesUrl } from 'cloud-ide-lms-model';
13
- import { d as CideLytProgramSectionSelectorComponent } from './cloud-ide-academics-cloud-ide-academics-Dd-B1hBe.mjs';
14
-
15
- class CideAcademicsBonafideRequestFormComponent {
16
- destroyRef = inject(DestroyRef);
17
- bonafideService = inject(CideAcademicsBonafideService);
18
- fb = inject(FormBuilder);
19
- router = inject(Router);
20
- notificationService = inject(NotificationService);
21
- appStateHelper = inject(AppStateHelperService);
22
- http = inject(HttpClient);
23
- form;
24
- loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
25
- initializing = signal(true, ...(ngDevMode ? [{ debugName: "initializing" }] : []));
26
- isStudentUser = signal(false, ...(ngDevMode ? [{ debugName: "isStudentUser" }] : []));
27
- // Store student and entity IDs
28
- studentId = null;
29
- entityId = null;
30
- // For non-student users: class/section/student selection
31
- studentsList = signal([], ...(ngDevMode ? [{ debugName: "studentsList" }] : []));
32
- studentsLoading = signal(false, ...(ngDevMode ? [{ debugName: "studentsLoading" }] : []));
33
- selectedStudent = signal(null, ...(ngDevMode ? [{ debugName: "selectedStudent" }] : []));
34
- // Computed: show class/section selector for non-student users
35
- showClassSectionSelector = computed(() => !this.isStudentUser(), ...(ngDevMode ? [{ debugName: "showClassSectionSelector" }] : []));
36
- showStudentSelector = computed(() => {
37
- if (this.isStudentUser())
38
- return false;
39
- const formValue = this.form.value;
40
- return !!(formValue.class_program_id || formValue.section_id);
41
- }, ...(ngDevMode ? [{ debugName: "showStudentSelector" }] : []));
42
- ngOnInit() {
43
- // Initialize form with conditional fields
44
- this.form = this.fb.group({
45
- // Common fields
46
- abnr_purpose: ['', Validators.required],
47
- abnr_remarks: [''],
48
- // For non-student users: class/section/student selection
49
- class_program_id: [''],
50
- branch_id: [''],
51
- term_id: [''],
52
- section_id: [''],
53
- selected_student_id: ['']
54
- });
55
- // Watch for class/section changes to load students
56
- this.setupClassSectionWatchers();
57
- // Load student and entity data from admission
58
- this.loadStudentAndEntityData();
59
- }
60
- /**
61
- * Setup watchers for class/section changes to load students
62
- */
63
- setupClassSectionWatchers() {
64
- // Watch for section_id changes to load students
65
- this.form.get('section_id')?.valueChanges
66
- .pipe(takeUntilDestroyed(this.destroyRef))
67
- .subscribe(() => {
68
- this.loadStudentsByClassSection();
69
- });
70
- // Watch for class_program_id changes (if section not available)
71
- this.form.get('class_program_id')?.valueChanges
72
- .pipe(takeUntilDestroyed(this.destroyRef))
73
- .subscribe(() => {
74
- // Reset section and student when class changes
75
- this.form.patchValue({ section_id: '', selected_student_id: '' }, { emitEvent: false });
76
- this.loadStudentsByClassSection();
77
- });
78
- }
79
- /**
80
- * Update validators based on user type
81
- */
82
- updateValidators() {
83
- const isStudent = this.isStudentUser();
84
- const studentControl = this.form.get('selected_student_id');
85
- if (!isStudent && studentControl) {
86
- // Non-student: make student selection required
87
- studentControl.setValidators([Validators.required]);
88
- }
89
- else if (isStudent && studentControl) {
90
- // Student: remove required validator
91
- studentControl.clearValidators();
92
- }
93
- studentControl?.updateValueAndValidity({ emitEvent: false });
94
- }
95
- /**
96
- * Load students based on selected class/section
97
- */
98
- loadStudentsByClassSection() {
99
- const classProgramId = this.form.get('class_program_id')?.value;
100
- const sectionId = this.form.get('section_id')?.value;
101
- if (!classProgramId) {
102
- this.studentsList.set([]);
103
- this.form.patchValue({ selected_student_id: '' }, { emitEvent: false });
104
- return;
105
- }
106
- this.studentsLoading.set(true);
107
- // Build query params for admission list
108
- const queryParams = {
109
- admap_class_program_id_acacpm: classProgramId,
110
- admap_isactive: true
111
- };
112
- if (sectionId) {
113
- queryParams.admap_section_id_acapts = sectionId;
114
- }
115
- // Use generateStringFromObject to create encoded query string
116
- const queryString = generateStringFromObject(queryParams);
117
- const admissionUrl = cidePath.join([
118
- hostManagerRoutesUrl.cideSuiteHost,
119
- coreRoutesUrl.module,
120
- 'admission',
121
- queryString
122
- ]);
123
- this.http.get(admissionUrl)
124
- .pipe(takeUntilDestroyed(this.destroyRef))
125
- .subscribe({
126
- next: (response) => {
127
- if (response?.success && response?.data) {
128
- const admissions = Array.isArray(response.data) ? response.data : [response.data];
129
- // Map to student options
130
- const students = admissions
131
- .filter((adm) => adm.admap_student_id)
132
- .map((adm) => ({
133
- value: adm.admap_student_id,
134
- label: `${adm.admap_first_name || ''} ${adm.admap_middle_name || ''} ${adm.admap_last_name || ''}`.trim() || adm.admap_student_id,
135
- admission: adm
136
- }));
137
- this.studentsList.set(students);
138
- }
139
- else {
140
- this.studentsList.set([]);
141
- }
142
- this.studentsLoading.set(false);
143
- },
144
- error: (err) => {
145
- console.error('Error loading students:', err);
146
- this.notificationService.error('Failed to load students. Please try again.');
147
- this.studentsList.set([]);
148
- this.studentsLoading.set(false);
149
- }
150
- });
151
- }
152
- /**
153
- * Load student ID and entity ID from admission data
154
- * Determines if user is a student or non-student
155
- */
156
- loadStudentAndEntityData() {
157
- this.initializing.set(true);
158
- // Get current user
159
- const currentUser = this.appStateHelper.getCurrentUser();
160
- if (!currentUser?._id) {
161
- this.notificationService.error('User not authenticated');
162
- this.initializing.set(false);
163
- return;
164
- }
165
- // Get student ID from admission form using user_id
166
- const userId = currentUser._id;
167
- const queryParams = new URLSearchParams({ admap_user_id_auth: userId }).toString();
168
- // Use the same pattern as fee components - admission is under core module
169
- const admissionUrl = cidePath.join([
170
- hostManagerRoutesUrl.cideSuiteHost,
171
- coreRoutesUrl.module,
172
- 'admission',
173
- queryParams
174
- ]);
175
- this.http.get(admissionUrl)
176
- .pipe(takeUntilDestroyed(this.destroyRef))
177
- .subscribe({
178
- next: (admissionResponse) => {
179
- if (admissionResponse?.success && admissionResponse?.data) {
180
- // Get admission data (might be array or single object)
181
- const admissionData = Array.isArray(admissionResponse.data)
182
- ? admissionResponse.data[0]
183
- : admissionResponse.data;
184
- // Check if user is a student (has student_id in admission)
185
- const hasStudentId = !!(admissionData?.admap_student_id);
186
- this.isStudentUser.set(hasStudentId);
187
- // Update validators based on user type
188
- this.updateValidators();
189
- if (hasStudentId) {
190
- // Student user: auto-populate student and entity IDs
191
- this.studentId = admissionData.admap_student_id;
192
- this.entityId = admissionData?.admap_entity_id_syen || null;
193
- // If entity ID not found in admission, try to get from active entity
194
- if (!this.entityId) {
195
- const activeEntity = this.appStateHelper.activeEntity();
196
- if (activeEntity?._id) {
197
- this.entityId = activeEntity._id;
198
- }
199
- }
200
- if (!this.entityId) {
201
- this.notificationService.warning('Entity ID not found. Please contact administrator.');
202
- }
203
- }
204
- else {
205
- // Non-student user: need to select class/section/student
206
- // Get entity ID from active entity
207
- const activeEntity = this.appStateHelper.activeEntity();
208
- if (activeEntity?._id) {
209
- this.entityId = activeEntity._id;
210
- }
211
- else {
212
- this.notificationService.warning('Entity ID not found. Please contact administrator.');
213
- }
214
- }
215
- }
216
- else {
217
- // No admission data found - user is likely non-student
218
- this.isStudentUser.set(false);
219
- this.updateValidators();
220
- const activeEntity = this.appStateHelper.activeEntity();
221
- if (activeEntity?._id) {
222
- this.entityId = activeEntity._id;
223
- }
224
- }
225
- this.initializing.set(false);
226
- },
227
- error: (err) => {
228
- console.error('Error loading admission data:', err);
229
- // On error, assume non-student and get entity from active entity
230
- this.isStudentUser.set(false);
231
- this.updateValidators();
232
- const activeEntity = this.appStateHelper.activeEntity();
233
- if (activeEntity?._id) {
234
- this.entityId = activeEntity._id;
235
- }
236
- this.initializing.set(false);
237
- }
238
- });
239
- }
240
- onSubmit() {
241
- if (this.form.valid) {
242
- // Determine student ID based on user type
243
- let finalStudentId = null;
244
- if (this.isStudentUser()) {
245
- // Student user: use auto-fetched student ID
246
- finalStudentId = this.studentId;
247
- }
248
- else {
249
- // Non-student user: use selected student ID
250
- finalStudentId = this.form.get('selected_student_id')?.value || null;
251
- }
252
- // Validate required data
253
- if (!finalStudentId) {
254
- if (this.isStudentUser()) {
255
- this.notificationService.error('Student ID is required. Please ensure your admission is confirmed.');
256
- }
257
- else {
258
- this.notificationService.error('Please select a student.');
259
- }
260
- return;
261
- }
262
- if (!this.entityId) {
263
- this.notificationService.error('Entity ID is required. Please contact administrator.');
264
- return;
265
- }
266
- this.loading.set(true);
267
- // Build payload with all required fields
268
- const payload = {
269
- abnr_student_id_auth: finalStudentId,
270
- abnr_entity_id_syen: this.entityId,
271
- abnr_purpose: this.form.value.abnr_purpose,
272
- abnr_remarks: this.form.value.abnr_remarks || ''
273
- };
274
- this.bonafideService.createRequest(payload)
275
- .pipe(takeUntilDestroyed(this.destroyRef))
276
- .subscribe({
277
- next: (response) => {
278
- if (response.success) {
279
- this.notificationService.success('Bonafide request created successfully');
280
- this.router.navigate(['/control-panel/bonafide']);
281
- }
282
- else {
283
- this.notificationService.error(response.message || 'Failed to create request');
284
- }
285
- this.loading.set(false);
286
- },
287
- error: (err) => {
288
- console.error('Error creating bonafide request:', err);
289
- this.notificationService.error(err.error?.message || 'Failed to create request');
290
- this.loading.set(false);
291
- }
292
- });
293
- }
294
- }
295
- cancel() {
296
- this.router.navigate(['/control-panel/bonafide']);
297
- }
298
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideAcademicsBonafideRequestFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
299
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideAcademicsBonafideRequestFormComponent, isStandalone: true, selector: "cide-academics-bonafide-request-form", ngImport: i0, template: "<!-- Bonafide Request Form with Shared Wrapper -->\r\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'academics_bonafide_form' }\">\r\n <div class=\"tw-w-full tw-h-full\">\r\n @if (initializing()) {\r\n <!-- Loading State -->\r\n <div class=\"tw-w-full tw-h-full tw-flex tw-items-center tw-justify-center\">\r\n <div class=\"tw-text-center\">\r\n <div class=\"tw-text-gray-600 tw-mb-2\">Loading student information...</div>\r\n <div class=\"tw-text-sm tw-text-gray-500\">Please wait</div>\r\n </div>\r\n </div>\r\n } @else {\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" class=\"tw-w-full tw-table tw-h-full tw-bg-transparent\"\r\n [class.tw-opacity-60]=\"loading()\">\r\n \r\n <!-- Form Content -->\r\n <div class=\"tw-table-row\">\r\n <div class=\"tw-table-cell tw-w-full tw-px-6 tw-py-6\">\r\n <div class=\"tw-transition-opacity tw-duration-300\" [class.tw-opacity-60]=\"loading()\">\r\n <!-- Form Fields -->\r\n <div class=\"tw-space-y-6\">\r\n <!-- Class/Section Selector for Non-Student Users -->\r\n @if (showClassSectionSelector()) {\r\n <div class=\"tw-max-w-4xl\">\r\n <div class=\"tw-mb-4\">\r\n <h3 class=\"tw-text-sm tw-font-semibold tw-text-gray-700 tw-mb-2\">Select Class & Section</h3>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Select the class and section to find the student</p>\r\n </div>\r\n <cide-lyt-program-section-selector\r\n [formGroup]=\"form\"\r\n classProgramControlName=\"class_program_id\"\r\n branchControlName=\"branch_id\"\r\n termControlName=\"term_id\"\r\n sectionControlName=\"section_id\"\r\n [showLabels]=\"true\"\r\n [disabled]=\"loading()\">\r\n </cide-lyt-program-section-selector>\r\n </div>\r\n }\r\n \r\n <!-- Student Selection for Non-Student Users -->\r\n @if (showStudentSelector()) {\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-select\r\n label=\"Select Student\"\r\n formControlName=\"selected_student_id\"\r\n [options]=\"studentsList()\"\r\n [loading]=\"studentsLoading()\"\r\n placeholder=\"Select a student\"\r\n valueKey=\"value\"\r\n labelKey=\"label\"\r\n size=\"md\"\r\n [required]=\"true\"\r\n [disabled]=\"loading() || studentsLoading()\">\r\n </cide-ele-select>\r\n </div>\r\n }\r\n \r\n <!-- Purpose Field -->\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-input\r\n label=\"Purpose\"\r\n formControlName=\"abnr_purpose\"\r\n [required]=\"true\"\r\n placeholder=\"Enter purpose for bonafide certificate\"\r\n size=\"md\"\r\n [disabled]=\"loading()\">\r\n </cide-ele-input>\r\n </div>\r\n \r\n <!-- Remarks Field -->\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-textarea\r\n label=\"Remarks\"\r\n formControlName=\"abnr_remarks\"\r\n placeholder=\"Enter any additional remarks\"\r\n rows=\"4\"\r\n size=\"md\"\r\n [disabled]=\"loading()\">\r\n </cide-ele-textarea>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- Form Actions -->\r\n <div class=\"tw-table-row tw-h-0\">\r\n <div class=\"tw-table-cell tw-w-full tw-px-6 tw-py-2 tw-bg-gray-50 tw-border-t tw-border-gray-200\">\r\n <div class=\"tw-flex tw-flex-col tw-gap-3\">\r\n <!-- Error Message -->\r\n <div class=\"tw-w-full\">\r\n <cide-form-field-error [formGroup]=\"form\"></cide-form-field-error>\r\n </div>\r\n \r\n <!-- Action Buttons -->\r\n <div class=\"tw-flex tw-justify-end tw-gap-4\">\r\n <button \r\n cideEleButton \r\n type=\"button\" \r\n variant=\"secondary\" \r\n (click)=\"cancel()\"\r\n [disabled]=\"loading()\">\r\n Cancel\r\n </button>\r\n \r\n <button \r\n cideEleButton \r\n type=\"submit\" \r\n variant=\"primary\" \r\n [disabled]=\"!form.valid || loading()\"\r\n [loading]=\"loading()\"\r\n leftIcon=\"save\">\r\n Submit Request\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n }\r\n </div>\r\n</cide-lyt-shared-wrapper>\r\n\r\n", styles: [":host{@apply tw-w-full tw-h-full tw-flex tw-flex-col;}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: CideInputComponent, selector: "cide-ele-input", inputs: ["fill", "label", "labelHide", "disabled", "clearInput", "labelPlacement", "labelDir", "placeholder", "leadingIcon", "trailingIcon", "helperText", "helperTextCollapse", "hideHelperAndErrorText", "errorText", "maxlength", "minlength", "required", "autocapitalize", "autocomplete", "type", "width", "id", "ngModel", "option", "min", "max", "step", "size"], outputs: ["ngModelChange"] }, { kind: "component", type: CideTextareaComponent, selector: "cide-ele-textarea", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "minlength", "maxlength", "rows", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput"], outputs: ["ngModelChange"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton], cide-ele-button", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "component", type: CideFormFieldErrorComponent, selector: "cide-form-field-error", inputs: ["control", "formGroup", "fieldName", "customMessages"] }, { kind: "component", type: CideLytSharedWrapperComponent, selector: "cide-lyt-shared-wrapper", inputs: ["shared_wrapper_setup_param", "breadcrumb_data"] }, { kind: "component", type: CideLytProgramSectionSelectorComponent, selector: "cide-lyt-program-section-selector", inputs: ["formGroup", "classProgramControlName", "branchControlName", "termControlName", "sectionControlName", "academicYearId", "entityId", "disabled", "showLabels", "gridCols", "showAllPrograms", "includeInactive"], outputs: ["valuesChange"] }, { kind: "component", type: CideSelectComponent, selector: "cide-ele-select", inputs: ["label", "labelHide", "placeholder", "helperText", "errorText", "required", "disabled", "id", "ngModel", "size", "fill", "labelPlacement", "labelDir", "leadingIcon", "trailingIcon", "clearInput", "options", "multiple", "searchable", "showSearchInput", "loading", "valueKey", "labelKey", "treeView"], outputs: ["ngModelChange", "change", "searchChange"] }] });
300
- }
301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideAcademicsBonafideRequestFormComponent, decorators: [{
302
- type: Component,
303
- args: [{ selector: 'cide-academics-bonafide-request-form', standalone: true, imports: [
304
- CommonModule,
305
- ReactiveFormsModule,
306
- CideInputComponent,
307
- CideTextareaComponent,
308
- CideEleButtonComponent,
309
- CideFormFieldErrorComponent,
310
- CideLytSharedWrapperComponent,
311
- CideLytProgramSectionSelectorComponent,
312
- CideSelectComponent
313
- ], template: "<!-- Bonafide Request Form with Shared Wrapper -->\r\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'academics_bonafide_form' }\">\r\n <div class=\"tw-w-full tw-h-full\">\r\n @if (initializing()) {\r\n <!-- Loading State -->\r\n <div class=\"tw-w-full tw-h-full tw-flex tw-items-center tw-justify-center\">\r\n <div class=\"tw-text-center\">\r\n <div class=\"tw-text-gray-600 tw-mb-2\">Loading student information...</div>\r\n <div class=\"tw-text-sm tw-text-gray-500\">Please wait</div>\r\n </div>\r\n </div>\r\n } @else {\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" class=\"tw-w-full tw-table tw-h-full tw-bg-transparent\"\r\n [class.tw-opacity-60]=\"loading()\">\r\n \r\n <!-- Form Content -->\r\n <div class=\"tw-table-row\">\r\n <div class=\"tw-table-cell tw-w-full tw-px-6 tw-py-6\">\r\n <div class=\"tw-transition-opacity tw-duration-300\" [class.tw-opacity-60]=\"loading()\">\r\n <!-- Form Fields -->\r\n <div class=\"tw-space-y-6\">\r\n <!-- Class/Section Selector for Non-Student Users -->\r\n @if (showClassSectionSelector()) {\r\n <div class=\"tw-max-w-4xl\">\r\n <div class=\"tw-mb-4\">\r\n <h3 class=\"tw-text-sm tw-font-semibold tw-text-gray-700 tw-mb-2\">Select Class & Section</h3>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Select the class and section to find the student</p>\r\n </div>\r\n <cide-lyt-program-section-selector\r\n [formGroup]=\"form\"\r\n classProgramControlName=\"class_program_id\"\r\n branchControlName=\"branch_id\"\r\n termControlName=\"term_id\"\r\n sectionControlName=\"section_id\"\r\n [showLabels]=\"true\"\r\n [disabled]=\"loading()\">\r\n </cide-lyt-program-section-selector>\r\n </div>\r\n }\r\n \r\n <!-- Student Selection for Non-Student Users -->\r\n @if (showStudentSelector()) {\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-select\r\n label=\"Select Student\"\r\n formControlName=\"selected_student_id\"\r\n [options]=\"studentsList()\"\r\n [loading]=\"studentsLoading()\"\r\n placeholder=\"Select a student\"\r\n valueKey=\"value\"\r\n labelKey=\"label\"\r\n size=\"md\"\r\n [required]=\"true\"\r\n [disabled]=\"loading() || studentsLoading()\">\r\n </cide-ele-select>\r\n </div>\r\n }\r\n \r\n <!-- Purpose Field -->\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-input\r\n label=\"Purpose\"\r\n formControlName=\"abnr_purpose\"\r\n [required]=\"true\"\r\n placeholder=\"Enter purpose for bonafide certificate\"\r\n size=\"md\"\r\n [disabled]=\"loading()\">\r\n </cide-ele-input>\r\n </div>\r\n \r\n <!-- Remarks Field -->\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-textarea\r\n label=\"Remarks\"\r\n formControlName=\"abnr_remarks\"\r\n placeholder=\"Enter any additional remarks\"\r\n rows=\"4\"\r\n size=\"md\"\r\n [disabled]=\"loading()\">\r\n </cide-ele-textarea>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- Form Actions -->\r\n <div class=\"tw-table-row tw-h-0\">\r\n <div class=\"tw-table-cell tw-w-full tw-px-6 tw-py-2 tw-bg-gray-50 tw-border-t tw-border-gray-200\">\r\n <div class=\"tw-flex tw-flex-col tw-gap-3\">\r\n <!-- Error Message -->\r\n <div class=\"tw-w-full\">\r\n <cide-form-field-error [formGroup]=\"form\"></cide-form-field-error>\r\n </div>\r\n \r\n <!-- Action Buttons -->\r\n <div class=\"tw-flex tw-justify-end tw-gap-4\">\r\n <button \r\n cideEleButton \r\n type=\"button\" \r\n variant=\"secondary\" \r\n (click)=\"cancel()\"\r\n [disabled]=\"loading()\">\r\n Cancel\r\n </button>\r\n \r\n <button \r\n cideEleButton \r\n type=\"submit\" \r\n variant=\"primary\" \r\n [disabled]=\"!form.valid || loading()\"\r\n [loading]=\"loading()\"\r\n leftIcon=\"save\">\r\n Submit Request\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n }\r\n </div>\r\n</cide-lyt-shared-wrapper>\r\n\r\n", styles: [":host{@apply tw-w-full tw-h-full tw-flex tw-flex-col;}\n"] }]
314
- }] });
315
-
316
- export { CideAcademicsBonafideRequestFormComponent };
317
- //# sourceMappingURL=cloud-ide-academics-bonafide-request-form.component-CM3ISuhU.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloud-ide-academics-bonafide-request-form.component-CM3ISuhU.mjs","sources":["../../../projects/cloud-ide-academics/src/lib/collection/bonafide/components/bonafide-request-form/bonafide-request-form.component.ts","../../../projects/cloud-ide-academics/src/lib/collection/bonafide/components/bonafide-request-form/bonafide-request-form.component.html"],"sourcesContent":["import { Component, signal, DestroyRef, inject, OnInit, computed } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { Router } from '@angular/router';\nimport { HttpClient } from '@angular/common/http';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CideInputComponent, CideTextareaComponent, CideEleButtonComponent, CideFormFieldErrorComponent, CideSelectComponent } from 'cloud-ide-element';\nimport { NotificationService } from 'cloud-ide-element';\nimport { CideLytSharedWrapperComponent, AppStateHelperService } from 'cloud-ide-layout';\nimport { CideAcademicsBonafideService } from '../../services/bonafide.service';\nimport { cidePath, coreRoutesUrl, hostManagerRoutesUrl, generateStringFromObject } from 'cloud-ide-lms-model';\nimport { CideLytProgramSectionSelectorComponent } from '../../../../../public-api';\n\n@Component({\n selector: 'cide-academics-bonafide-request-form',\n standalone: true,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n CideInputComponent,\n CideTextareaComponent,\n CideEleButtonComponent,\n CideFormFieldErrorComponent,\n CideLytSharedWrapperComponent,\n CideLytProgramSectionSelectorComponent,\n CideSelectComponent\n ],\n templateUrl: './bonafide-request-form.component.html',\n styles: [`\n :host {\n @apply tw-w-full tw-h-full tw-flex tw-flex-col;\n }\n `]\n})\nexport class CideAcademicsBonafideRequestFormComponent implements OnInit {\n private destroyRef = inject(DestroyRef);\n private bonafideService = inject(CideAcademicsBonafideService);\n private fb = inject(FormBuilder);\n private router = inject(Router);\n private notificationService = inject(NotificationService);\n private appStateHelper = inject(AppStateHelperService);\n private http = inject(HttpClient);\n\n form!: FormGroup;\n loading = signal(false);\n initializing = signal(true);\n isStudentUser = signal<boolean>(false);\n \n // Store student and entity IDs\n private studentId: string | null = null;\n private entityId: string | null = null;\n \n // For non-student users: class/section/student selection\n studentsList = signal<any[]>([]);\n studentsLoading = signal(false);\n selectedStudent = signal<any | null>(null);\n \n // Computed: show class/section selector for non-student users\n showClassSectionSelector = computed(() => !this.isStudentUser());\n showStudentSelector = computed(() => {\n if (this.isStudentUser()) return false;\n const formValue = this.form.value;\n return !!(formValue.class_program_id || formValue.section_id);\n });\n\n ngOnInit(): void {\n // Initialize form with conditional fields\n this.form = this.fb.group({\n // Common fields\n abnr_purpose: ['', Validators.required],\n abnr_remarks: [''],\n // For non-student users: class/section/student selection\n class_program_id: [''],\n branch_id: [''],\n term_id: [''],\n section_id: [''],\n selected_student_id: ['']\n });\n \n // Watch for class/section changes to load students\n this.setupClassSectionWatchers();\n \n // Load student and entity data from admission\n this.loadStudentAndEntityData();\n }\n \n /**\n * Setup watchers for class/section changes to load students\n */\n private setupClassSectionWatchers(): void {\n // Watch for section_id changes to load students\n this.form.get('section_id')?.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.loadStudentsByClassSection();\n });\n \n // Watch for class_program_id changes (if section not available)\n this.form.get('class_program_id')?.valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n // Reset section and student when class changes\n this.form.patchValue({ section_id: '', selected_student_id: '' }, { emitEvent: false });\n this.loadStudentsByClassSection();\n });\n }\n \n /**\n * Update validators based on user type\n */\n private updateValidators(): void {\n const isStudent = this.isStudentUser();\n const studentControl = this.form.get('selected_student_id');\n \n if (!isStudent && studentControl) {\n // Non-student: make student selection required\n studentControl.setValidators([Validators.required]);\n } else if (isStudent && studentControl) {\n // Student: remove required validator\n studentControl.clearValidators();\n }\n studentControl?.updateValueAndValidity({ emitEvent: false });\n }\n \n /**\n * Load students based on selected class/section\n */\n private loadStudentsByClassSection(): void {\n const classProgramId = this.form.get('class_program_id')?.value;\n const sectionId = this.form.get('section_id')?.value;\n \n if (!classProgramId) {\n this.studentsList.set([]);\n this.form.patchValue({ selected_student_id: '' }, { emitEvent: false });\n return;\n }\n \n this.studentsLoading.set(true);\n \n // Build query params for admission list\n const queryParams: any = {\n admap_class_program_id_acacpm: classProgramId,\n admap_isactive: true\n };\n \n if (sectionId) {\n queryParams.admap_section_id_acapts = sectionId;\n }\n \n // Use generateStringFromObject to create encoded query string\n const queryString = generateStringFromObject(queryParams);\n \n const admissionUrl = cidePath.join([\n hostManagerRoutesUrl.cideSuiteHost,\n coreRoutesUrl.module,\n 'admission',\n queryString\n ]);\n \n this.http.get<any>(admissionUrl)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (response) => {\n if (response?.success && response?.data) {\n const admissions = Array.isArray(response.data) ? response.data : [response.data];\n // Map to student options\n const students = admissions\n .filter((adm: any) => adm.admap_student_id)\n .map((adm: any) => ({\n value: adm.admap_student_id,\n label: `${adm.admap_first_name || ''} ${adm.admap_middle_name || ''} ${adm.admap_last_name || ''}`.trim() || adm.admap_student_id,\n admission: adm\n }));\n this.studentsList.set(students);\n } else {\n this.studentsList.set([]);\n }\n this.studentsLoading.set(false);\n },\n error: (err) => {\n console.error('Error loading students:', err);\n this.notificationService.error('Failed to load students. Please try again.');\n this.studentsList.set([]);\n this.studentsLoading.set(false);\n }\n });\n }\n\n /**\n * Load student ID and entity ID from admission data\n * Determines if user is a student or non-student\n */\n private loadStudentAndEntityData(): void {\n this.initializing.set(true);\n \n // Get current user\n const currentUser = this.appStateHelper.getCurrentUser();\n if (!currentUser?._id) {\n this.notificationService.error('User not authenticated');\n this.initializing.set(false);\n return;\n }\n\n // Get student ID from admission form using user_id\n const userId = currentUser._id;\n const queryParams = new URLSearchParams({ admap_user_id_auth: userId }).toString();\n \n // Use the same pattern as fee components - admission is under core module\n const admissionUrl = cidePath.join([\n hostManagerRoutesUrl.cideSuiteHost,\n coreRoutesUrl.module,\n 'admission',\n queryParams\n ]);\n \n this.http.get<any>(admissionUrl)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (admissionResponse) => {\n if (admissionResponse?.success && admissionResponse?.data) {\n // Get admission data (might be array or single object)\n const admissionData = Array.isArray(admissionResponse.data) \n ? admissionResponse.data[0] \n : admissionResponse.data;\n \n // Check if user is a student (has student_id in admission)\n const hasStudentId = !!(admissionData?.admap_student_id);\n this.isStudentUser.set(hasStudentId);\n \n // Update validators based on user type\n this.updateValidators();\n \n if (hasStudentId) {\n // Student user: auto-populate student and entity IDs\n this.studentId = admissionData.admap_student_id;\n this.entityId = admissionData?.admap_entity_id_syen || null;\n \n // If entity ID not found in admission, try to get from active entity\n if (!this.entityId) {\n const activeEntity = this.appStateHelper.activeEntity();\n if (activeEntity?._id) {\n this.entityId = activeEntity._id;\n }\n }\n \n if (!this.entityId) {\n this.notificationService.warning('Entity ID not found. Please contact administrator.');\n }\n } else {\n // Non-student user: need to select class/section/student\n // Get entity ID from active entity\n const activeEntity = this.appStateHelper.activeEntity();\n if (activeEntity?._id) {\n this.entityId = activeEntity._id;\n } else {\n this.notificationService.warning('Entity ID not found. Please contact administrator.');\n }\n }\n } else {\n // No admission data found - user is likely non-student\n this.isStudentUser.set(false);\n this.updateValidators();\n const activeEntity = this.appStateHelper.activeEntity();\n if (activeEntity?._id) {\n this.entityId = activeEntity._id;\n }\n }\n this.initializing.set(false);\n },\n error: (err) => {\n console.error('Error loading admission data:', err);\n // On error, assume non-student and get entity from active entity\n this.isStudentUser.set(false);\n this.updateValidators();\n const activeEntity = this.appStateHelper.activeEntity();\n if (activeEntity?._id) {\n this.entityId = activeEntity._id;\n }\n this.initializing.set(false);\n }\n });\n }\n\n onSubmit(): void {\n if (this.form.valid) {\n // Determine student ID based on user type\n let finalStudentId: string | null = null;\n \n if (this.isStudentUser()) {\n // Student user: use auto-fetched student ID\n finalStudentId = this.studentId;\n } else {\n // Non-student user: use selected student ID\n finalStudentId = this.form.get('selected_student_id')?.value || null;\n }\n \n // Validate required data\n if (!finalStudentId) {\n if (this.isStudentUser()) {\n this.notificationService.error('Student ID is required. Please ensure your admission is confirmed.');\n } else {\n this.notificationService.error('Please select a student.');\n }\n return;\n }\n \n if (!this.entityId) {\n this.notificationService.error('Entity ID is required. Please contact administrator.');\n return;\n }\n \n this.loading.set(true);\n \n // Build payload with all required fields\n const payload = {\n abnr_student_id_auth: finalStudentId,\n abnr_entity_id_syen: this.entityId,\n abnr_purpose: this.form.value.abnr_purpose,\n abnr_remarks: this.form.value.abnr_remarks || ''\n };\n \n this.bonafideService.createRequest(payload)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (response) => {\n if (response.success) {\n this.notificationService.success('Bonafide request created successfully');\n this.router.navigate(['/control-panel/bonafide']);\n } else {\n this.notificationService.error(response.message || 'Failed to create request');\n }\n this.loading.set(false);\n },\n error: (err) => {\n console.error('Error creating bonafide request:', err);\n this.notificationService.error(err.error?.message || 'Failed to create request');\n this.loading.set(false);\n }\n });\n }\n }\n\n cancel(): void {\n this.router.navigate(['/control-panel/bonafide']);\n }\n}\n\n","<!-- Bonafide Request Form with Shared Wrapper -->\r\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'academics_bonafide_form' }\">\r\n <div class=\"tw-w-full tw-h-full\">\r\n @if (initializing()) {\r\n <!-- Loading State -->\r\n <div class=\"tw-w-full tw-h-full tw-flex tw-items-center tw-justify-center\">\r\n <div class=\"tw-text-center\">\r\n <div class=\"tw-text-gray-600 tw-mb-2\">Loading student information...</div>\r\n <div class=\"tw-text-sm tw-text-gray-500\">Please wait</div>\r\n </div>\r\n </div>\r\n } @else {\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" class=\"tw-w-full tw-table tw-h-full tw-bg-transparent\"\r\n [class.tw-opacity-60]=\"loading()\">\r\n \r\n <!-- Form Content -->\r\n <div class=\"tw-table-row\">\r\n <div class=\"tw-table-cell tw-w-full tw-px-6 tw-py-6\">\r\n <div class=\"tw-transition-opacity tw-duration-300\" [class.tw-opacity-60]=\"loading()\">\r\n <!-- Form Fields -->\r\n <div class=\"tw-space-y-6\">\r\n <!-- Class/Section Selector for Non-Student Users -->\r\n @if (showClassSectionSelector()) {\r\n <div class=\"tw-max-w-4xl\">\r\n <div class=\"tw-mb-4\">\r\n <h3 class=\"tw-text-sm tw-font-semibold tw-text-gray-700 tw-mb-2\">Select Class & Section</h3>\r\n <p class=\"tw-text-xs tw-text-gray-500\">Select the class and section to find the student</p>\r\n </div>\r\n <cide-lyt-program-section-selector\r\n [formGroup]=\"form\"\r\n classProgramControlName=\"class_program_id\"\r\n branchControlName=\"branch_id\"\r\n termControlName=\"term_id\"\r\n sectionControlName=\"section_id\"\r\n [showLabels]=\"true\"\r\n [disabled]=\"loading()\">\r\n </cide-lyt-program-section-selector>\r\n </div>\r\n }\r\n \r\n <!-- Student Selection for Non-Student Users -->\r\n @if (showStudentSelector()) {\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-select\r\n label=\"Select Student\"\r\n formControlName=\"selected_student_id\"\r\n [options]=\"studentsList()\"\r\n [loading]=\"studentsLoading()\"\r\n placeholder=\"Select a student\"\r\n valueKey=\"value\"\r\n labelKey=\"label\"\r\n size=\"md\"\r\n [required]=\"true\"\r\n [disabled]=\"loading() || studentsLoading()\">\r\n </cide-ele-select>\r\n </div>\r\n }\r\n \r\n <!-- Purpose Field -->\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-input\r\n label=\"Purpose\"\r\n formControlName=\"abnr_purpose\"\r\n [required]=\"true\"\r\n placeholder=\"Enter purpose for bonafide certificate\"\r\n size=\"md\"\r\n [disabled]=\"loading()\">\r\n </cide-ele-input>\r\n </div>\r\n \r\n <!-- Remarks Field -->\r\n <div class=\"tw-max-w-2xl\">\r\n <cide-ele-textarea\r\n label=\"Remarks\"\r\n formControlName=\"abnr_remarks\"\r\n placeholder=\"Enter any additional remarks\"\r\n rows=\"4\"\r\n size=\"md\"\r\n [disabled]=\"loading()\">\r\n </cide-ele-textarea>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- Form Actions -->\r\n <div class=\"tw-table-row tw-h-0\">\r\n <div class=\"tw-table-cell tw-w-full tw-px-6 tw-py-2 tw-bg-gray-50 tw-border-t tw-border-gray-200\">\r\n <div class=\"tw-flex tw-flex-col tw-gap-3\">\r\n <!-- Error Message -->\r\n <div class=\"tw-w-full\">\r\n <cide-form-field-error [formGroup]=\"form\"></cide-form-field-error>\r\n </div>\r\n \r\n <!-- Action Buttons -->\r\n <div class=\"tw-flex tw-justify-end tw-gap-4\">\r\n <button \r\n cideEleButton \r\n type=\"button\" \r\n variant=\"secondary\" \r\n (click)=\"cancel()\"\r\n [disabled]=\"loading()\">\r\n Cancel\r\n </button>\r\n \r\n <button \r\n cideEleButton \r\n type=\"submit\" \r\n variant=\"primary\" \r\n [disabled]=\"!form.valid || loading()\"\r\n [loading]=\"loading()\"\r\n leftIcon=\"save\">\r\n Submit Request\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n }\r\n </div>\r\n</cide-lyt-shared-wrapper>\r\n\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAkCa,yCAAyC,CAAA;AAC5C,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,eAAe,GAAG,MAAM,CAAC,4BAA4B,CAAC;AACtD,IAAA,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;AACxB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACjD,IAAA,cAAc,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC9C,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AAEjC,IAAA,IAAI;AACJ,IAAA,OAAO,GAAG,MAAM,CAAC,KAAK,mDAAC;AACvB,IAAA,YAAY,GAAG,MAAM,CAAC,IAAI,wDAAC;AAC3B,IAAA,aAAa,GAAG,MAAM,CAAU,KAAK,yDAAC;;IAG9B,SAAS,GAAkB,IAAI;IAC/B,QAAQ,GAAkB,IAAI;;AAGtC,IAAA,YAAY,GAAG,MAAM,CAAQ,EAAE,wDAAC;AAChC,IAAA,eAAe,GAAG,MAAM,CAAC,KAAK,2DAAC;AAC/B,IAAA,eAAe,GAAG,MAAM,CAAa,IAAI,2DAAC;;AAG1C,IAAA,wBAAwB,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA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loud-ide-academics/src/lib/collection/bonafide/components/bonafide-request-list/bonafide-request-list.component.ts","../../../projects/cloud-ide-academics/src/lib/collection/bonafide/components/bonafide-request-list/bonafide-request-list.component.html"],"sourcesContent":["import { Component, signal, DestroyRef, inject, computed, OnInit, effect, TemplateRef, viewChild } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CideEleDataGridComponent, CideEleButtonComponent, CideIconComponent, GridConfiguration, GridEvent, CideEleDropdownComponent, DropdownItem, NotificationService, CideSelectComponent } from 'cloud-ide-element';\nimport { AppStateHelperService, RightsService, CideLytSharedService, CideLytSharedWrapperComponent } from 'cloud-ide-layout';\nimport { CideAcademicsBonafideService } from '../../services/bonafide.service';\nimport { generateStringFromObject } from 'cloud-ide-lms-model';\n\ntype TemplateContext = { value: any; row: any; column: any };\n\n@Component({\n selector: 'cide-academics-bonafide-request-list',\n standalone: true,\n imports: [\n CommonModule,\n CideEleDataGridComponent,\n CideEleButtonComponent,\n CideIconComponent,\n CideLytSharedWrapperComponent,\n CideEleDropdownComponent,\n CideSelectComponent\n ],\n templateUrl: './bonafide-request-list.component.html',\n styles: [`\n .bonafide-list-container {\n @apply tw-w-full tw-h-full;\n }\n \n :host {\n @apply tw-w-full tw-h-full tw-flex tw-flex-col;\n }\n `]\n})\nexport class CideAcademicsBonafideRequestListComponent implements OnInit {\n private destroyRef = inject(DestroyRef);\n private bonafideService = inject(CideAcademicsBonafideService);\n private router = inject(Router);\n private route = inject(ActivatedRoute);\n private rightsService = inject(RightsService);\n private sharedService = inject(CideLytSharedService);\n private notificationService = inject(NotificationService);\n\n requests = signal<any[]>([]);\n total = signal<number>(0);\n loading = signal(false);\n error = signal<string | null>(null);\n selectedStatus = signal<string>('ALL');\n \n // Page config (title/subtitle) from page API\n pageTitle = signal<string>('');\n pageSubtitle = signal<string>('');\n pageCode = signal<string>('academics_bonafide_list');\n \n canCreate = computed(() => this.rightsService.hasRight('CREATE'));\n canView = computed(() => this.rightsService.hasRight('VIEW'));\n canDownload = computed(() => this.rightsService.hasRight('DOWNLOAD'));\n\n // Template references for custom renderers\n statusRendererTemplate = viewChild.required<TemplateRef<TemplateContext>>('statusRendererTemplate');\n actionsDropdownRendererTemplate = viewChild.required<TemplateRef<TemplateContext>>('actionsDropdownRendererTemplate');\n\n // Status filter options\n statusOptions = [\n { value: 'ALL', label: 'All Status' },\n { value: 'PENDING', label: 'Pending' },\n { value: 'IN_REVIEW', label: 'In Review' },\n { value: 'APPROVED', label: 'Approved' },\n { value: 'COMPLETED', label: 'Completed' },\n { value: 'REJECTED', label: 'Rejected' }\n ];\n\n // Constructor to set up reactive effect for page data\n constructor() {\n // Watch for page data changes in cache and update title/subtitle reactively\n effect(() => {\n const currentPageCode = this.pageCode();\n if (!currentPageCode) return;\n\n // Watch the page data cache signal from shared service\n const pageDataCache = this.sharedService.pageDataStore();\n const cachedData = pageDataCache[currentPageCode];\n const page = cachedData?.data?.page;\n \n if (page) {\n // Try to parse configuration for title/subtitle\n const cfgString = page?.sypg_configuration;\n if (cfgString) {\n try {\n const cfg = JSON.parse(cfgString);\n this.pageTitle.set(cfg.title || page?.sypg_title || '');\n this.pageSubtitle.set(cfg.subTitle || page?.sypg_desc || '');\n } catch (e) {\n console.warn('Invalid page config JSON', e);\n this.pageTitle.set(page?.sypg_title || '');\n this.pageSubtitle.set(page?.sypg_desc || '');\n }\n } else {\n this.pageTitle.set(page?.sypg_title || '');\n this.pageSubtitle.set(page?.sypg_desc || '');\n }\n }\n });\n }\n\n gridConfig = computed<GridConfiguration<any>>(() => ({\n id: 'bonafide-request-grid',\n columns: [\n { key: 'abnr_request_number', header: 'Request Number', type: 'text', width: 'md', align: 'left' },\n { key: 'abnr_purpose', header: 'Purpose', type: 'text', width: 'lg' },\n { key: 'abnr_request_date', header: 'Requested Date', type: 'date', width: 'md', align: 'center' },\n { key: 'abnr_status_id_sygms', header: 'Status', type: 'text', width: 'sm', align: 'center', renderer: 'statusRenderer' },\n { key: 'actions', header: 'Actions', type: 'text', width: 'sm', align: 'center', renderer: 'actionsDropdownRenderer' }\n ],\n data: this.requests(),\n trackBy: '_id',\n pagination: {\n enabled: true,\n pageSize: 10,\n pageSizeOptions: [10, 25, 50, 100],\n showQuickJump: true,\n showPageInfo: true,\n showRefresh: true\n },\n search: {\n enabled: true,\n placeholder: 'Search bonafide requests...',\n searchableColumns: ['abnr_purpose', 'abnr_request_number'],\n debounceMs: 300\n },\n loading: {\n useDefer: true,\n skeletonRows: 5,\n showOverlay: false\n },\n responsive: true,\n striped: false,\n bordered: true,\n compact: false,\n fullHeight: true\n }));\n\n templateRenderers = computed(() => ({\n statusRenderer: this.statusRendererTemplate(),\n actionsDropdownRenderer: this.actionsDropdownRendererTemplate()\n }));\n\n ngOnInit(): void {\n // Initialize rights for this page\n this.rightsService.initializeRights('academics_bonafide_list');\n\n // Initialize page code from route data\n this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(data => {\n const codeFromRoute = data['page']?.sypg_page_code || data['sypg_page_code'];\n const codeFromQuery = this.route.snapshot.queryParamMap.get('sypg_page_code');\n const finalCode = (codeFromRoute || codeFromQuery || this.pageCode()).toString();\n this.pageCode.set(finalCode);\n\n // Page title/subtitle will be updated reactively by the effect when page data is loaded\n // Also check immediately if data is already available\n const cached = finalCode ? this.sharedService.getCachedPageData(finalCode) : null;\n const page = data['page'] || cached?.data?.page;\n if (page) {\n const cfgString = page?.sypg_configuration;\n if (cfgString) {\n try {\n const cfg = JSON.parse(cfgString);\n this.pageTitle.set(cfg.title || page?.sypg_title || '');\n this.pageSubtitle.set(cfg.subTitle || page?.sypg_desc || '');\n } catch (e) {\n console.warn('Invalid page config JSON', e);\n this.pageTitle.set(page?.sypg_title || '');\n this.pageSubtitle.set(page?.sypg_desc || '');\n }\n } else {\n this.pageTitle.set(page?.sypg_title || '');\n this.pageSubtitle.set(page?.sypg_desc || '');\n }\n }\n });\n\n this.loadRequests();\n }\n\n loadRequests(filters?: any, pageIndex: number = 1, pageSize: number = 10): void {\n this.loading.set(true);\n this.error.set(null);\n\n const queryParams: any = {\n pageIndex,\n pageSize,\n ...filters\n };\n\n this.bonafideService.getRequestList(queryParams)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (response) => {\n if (response.success) {\n // Fix: Handle response structure correctly\n const data = response.data;\n this.requests.set(data?.requests || []);\n this.total.set(data?.total || 0);\n } else {\n this.error.set(response.message || 'Failed to load requests');\n this.requests.set([]);\n this.total.set(0);\n }\n this.loading.set(false);\n },\n error: (err) => {\n console.error('Error loading requests:', err);\n this.error.set(err.message || 'Failed to load requests');\n this.requests.set([]);\n this.total.set(0);\n this.loading.set(false);\n }\n });\n }\n\n onGridEvent(event: GridEvent): void {\n switch (event.type) {\n case 'pageChange': {\n // Handle pagination - data can be { page: number; pageSize: number } or { pageIndex: number } or just a number\n if (event.data && typeof event.data === 'object') {\n const pageData = event.data as { page?: number; pageIndex?: number; pageSize?: number };\n const pageIndex = pageData.pageIndex || pageData.page || 1;\n const pageSize = pageData.pageSize || 10;\n this.loadRequests(this.getFilters(), pageIndex, pageSize);\n } else if (typeof event.data === 'number') {\n this.loadRequests(this.getFilters(), event.data, 10);\n } else {\n this.loadRequests(this.getFilters());\n }\n break;\n }\n case 'refresh':\n this.loadRequests(this.getFilters());\n break;\n case 'search':\n // Handle search if needed\n this.loadRequests(this.getFilters());\n break;\n }\n }\n\n onStatusFilterChange(status: string | number | string[]): void {\n // Convert to string - handle array case by taking first element\n const statusStr = Array.isArray(status) ? status[0] : String(status);\n this.selectedStatus.set(statusStr);\n this.loadRequests(this.getFilters());\n }\n\n getFilters(): any {\n const filters: any = {};\n if (this.selectedStatus() !== 'ALL') {\n // Note: In a real implementation, you'd need to get status ID from master data\n // For now, we'll filter on the frontend or pass the status code\n filters.statusCode = this.selectedStatus();\n }\n return filters;\n }\n\n getStatusText(row: any): string {\n const status = row.abnr_status_id_sygms;\n if (!status) return 'N/A';\n if (typeof status === 'string') return status;\n return status.sygms_title || status.sygms_code || 'N/A';\n }\n\n getStatusBadgeClass(row: any): string {\n const statusText = this.getStatusText(row).toUpperCase();\n if (statusText.includes('PENDING')) {\n return 'tw-inline-flex tw-items-center tw-px-2.5 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-yellow-100 tw-text-yellow-800 dark:tw-bg-yellow-900/30 dark:tw-text-yellow-300';\n } else if (statusText.includes('REVIEW')) {\n return 'tw-inline-flex tw-items-center tw-px-2.5 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-blue-100 tw-text-blue-800 dark:tw-bg-blue-900/30 dark:tw-text-blue-300';\n } else if (statusText.includes('APPROVED')) {\n return 'tw-inline-flex tw-items-center tw-px-2.5 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-green-100 tw-text-green-800 dark:tw-bg-green-900/30 dark:tw-text-green-300';\n } else if (statusText.includes('COMPLETED')) {\n return 'tw-inline-flex tw-items-center tw-px-2.5 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-emerald-100 tw-text-emerald-800 dark:tw-bg-emerald-900/30 dark:tw-text-emerald-300';\n } else if (statusText.includes('REJECTED')) {\n return 'tw-inline-flex tw-items-center tw-px-2.5 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-red-100 tw-text-red-800 dark:tw-bg-red-900/30 dark:tw-text-red-300';\n }\n return 'tw-inline-flex tw-items-center tw-px-2.5 tw-py-1 tw-rounded-full tw-text-xs tw-font-medium tw-bg-gray-100 tw-text-gray-800 dark:tw-bg-gray-700 dark:tw-text-gray-300';\n }\n\n getActionDropdownItems(row: any): DropdownItem[] {\n const items: DropdownItem[] = [];\n\n if (this.canView()) {\n items.push({\n id: `view-${row._id || 'unknown'}`,\n label: 'View Details',\n icon: 'visibility'\n });\n }\n\n if (this.canDownload()) {\n if (row.abnr_soft_copy_id_cyfm) {\n items.push({\n id: `download-soft-${row._id || 'unknown'}`,\n label: 'Download Soft Copy',\n icon: 'download'\n });\n }\n\n if (row.abnr_stamped_copy_id_cyfm) {\n items.push({\n id: `download-stamped-${row._id || 'unknown'}`,\n label: 'Download Stamped Copy',\n icon: 'download'\n });\n }\n }\n\n if (items.length === 0) {\n items.push({\n id: `no-action-${row._id || 'unknown'}`,\n label: 'No actions available',\n icon: 'info',\n disabled: true\n });\n }\n\n return items;\n }\n\n onActionItemClick(item: DropdownItem, row: any): void {\n if (item.disabled) {\n return;\n }\n\n const itemId = item.id;\n \n if (itemId.startsWith('view-')) {\n this.viewRequest(row);\n } else if (itemId.startsWith('download-soft-')) {\n this.downloadCertificate(row, 'soft-copy');\n } else if (itemId.startsWith('download-stamped-')) {\n this.downloadCertificate(row, 'stamped-copy');\n }\n }\n\n viewRequest(row: any): void {\n if (!row._id) {\n this.notificationService.error('Request ID not found');\n return;\n }\n const query = generateStringFromObject({ abnr_id: row._id });\n this.router.navigate(['/control-panel/bonafide/view', query]);\n }\n\n downloadCertificate(row: any, fileType: 'soft-copy' | 'stamped-copy'): void {\n if (!row._id) {\n this.notificationService.error('Request ID not found');\n return;\n }\n\n try {\n this.bonafideService.downloadCertificate(row._id, fileType);\n this.notificationService.success(`Downloading ${fileType === 'soft-copy' ? 'soft copy' : 'stamped copy'}...`);\n } catch (error: any) {\n console.error('Error downloading certificate:', error);\n this.notificationService.error('Failed to download certificate');\n }\n }\n\n createNew(): void {\n this.router.navigate(['/control-panel/bonafide/create']);\n }\n}\n","<!-- Bonafide Request List with Shared Wrapper -->\r\n<cide-lyt-shared-wrapper [shared_wrapper_setup_param]=\"{ sypg_page_code: 'academics_bonafide_list' }\">\r\n <div class=\"bonafide-list-container tw-bg-white tw-shadow-lg tw-rounded-lg tw-table tw-h-full\">\r\n\r\n <!-- Header Section with Actions -->\r\n <div class=\"tw-table-row tw-h-0\">\r\n <div class=\"tw-px-6 tw-py-4 tw-border-b tw-border-gray-200 tw-bg-gray-50\">\r\n <div class=\"tw-flex tw-justify-end tw-items-center\">\r\n <!-- Actions -->\r\n <div class=\"tw-flex tw-items-center tw-space-x-3 tw-gap-2\">\r\n <!-- Status Filter -->\r\n <cide-ele-select\r\n [options]=\"statusOptions\"\r\n [ngModel]=\"selectedStatus()\"\r\n (ngModelChange)=\"onStatusFilterChange($event)\"\r\n placeholder=\"Filter by status\"\r\n class=\"tw-w-48\">\r\n </cide-ele-select>\r\n\r\n @if (canCreate()) {\r\n <button cideEleButton variant=\"primary\" size=\"sm\" (click)=\"createNew()\"\r\n class=\"tw-whitespace-nowrap tw-flex tw-items-center tw-gap-2\">\r\n <cide-ele-icon size=\"xs\" class=\"tw-w-6 tw-h-5\">add</cide-ele-icon>\r\n New Bonafide Request\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Error Message -->\r\n @if (error()) {\r\n <div class=\"tw-mt-4 tw-mx-6 tw-p-4 tw-bg-red-50 tw-border tw-border-red-200 tw-rounded-md\">\r\n <div class=\"tw-flex\">\r\n <cide-ele-icon name=\"error\" class=\"tw-text-red-400\"></cide-ele-icon>\r\n <div class=\"tw-ml-3\">\r\n <h3 class=\"tw-text-sm tw-font-medium tw-text-red-800\">Error</h3>\r\n <p class=\"tw-text-sm tw-text-red-700 tw-mt-1\">{{ error() }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Main Content Area -->\r\n <div class=\"tw-table-row\">\r\n <div class=\"tw-table-cell tw-h-full tw-relative\">\r\n <div class=\"tw-h-full tw-overflow-auto\">\r\n <!-- Data Grid Component -->\r\n <cide-ele-data-grid \r\n [config]=\"gridConfig()\"\r\n [templateRenderers]=\"templateRenderers()\"\r\n (gridEvent)=\"onGridEvent($event)\">\r\n </cide-ele-data-grid>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n <!-- Status Badge Template -->\r\n <ng-template #statusRendererTemplate let-value=\"value\" let-row=\"row\" let-column=\"column\">\r\n <div class=\"tw-flex tw-items-center tw-justify-center tw-py-3\">\r\n <span [class]=\"getStatusBadgeClass(row)\">\r\n {{ getStatusText(row) }}\r\n </span>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Actions Dropdown Template -->\r\n <ng-template #actionsDropdownRendererTemplate let-value=\"value\" let-row=\"row\" let-column=\"column\">\r\n <cide-ele-dropdown\r\n [items]=\"getActionDropdownItems(row)\"\r\n (itemClick)=\"onActionItemClick($event, row)\">\r\n </cide-ele-dropdown>\r\n </ng-template>\r\n</cide-lyt-shared-wrapper>\r\n"],"names":[],"mappings":";;;;;;;;;;MAkCa,yCAAyC,CAAA;AAC5C,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,eAAe,GAAG,MAAM,CAAC,4BAA4B,CAAC;AACtD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AACrC,IAAA,aAAa,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC5C,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAEzD,IAAA,QAAQ,GAAG,MAAM,CAAQ,EAAE,oDAAC;AAC5B,IAAA,KAAK,GAAG,MAAM,CAAS,CAAC,iDAAC;AACzB,IAAA,OAAO,GAAG,MAAM,CAAC,KAAK,mDAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAgB,IAAI,iDAAC;AACnC,IAAA,cAAc,GAAG,MAAM,CAAS,KAAK,0DAAC;;AAGtC,IAAA,SAAS,GAAG,MAAM,CAAS,EAAE,qDAAC;AAC9B,IAAA,YAAY,GAAG,MAAM,CAAS,EAAE,wDAAC;AACjC,IAAA,QAAQ,GAAG,MAAM,CAAS,yBAAyB,oDAAC;AAEpD,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC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