@iblai/iblai-js 2.3.14 → 2.3.16
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useRef, useEffect, useState, useCallback, useLayoutEffect, forwardRef, createElement as createElement$1, createContext, useContext, useMemo, useReducer, useImperativeHandle, isValidElement, Children, PureComponent, cloneElement, Component, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
|
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
|
-
import { selectSessionId, selectActiveChatMessages, useCachedSessionId, chatActions, LOCAL_STORAGE_KEYS, TimeTracker, getInitials, useTenantMetadata, useCurrentTenant, selectRbacPermissions, isPureWatcher, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, getVisibleAnalyticsTabs, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, WATCHER_HIDDEN_REPORTS, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, chatInputSliceActions, removeFile, WithFormPermissions, MENTOR_VISIBILITY } from '@iblai/web-utils';
|
|
4
|
+
import { selectSessionId, selectActiveChatMessages, useCachedSessionId, chatActions, LOCAL_STORAGE_KEYS, TimeTracker, getInitials, useTenantMetadata, useCurrentTenant, selectRbacPermissions, isPureWatcher, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, getVisibleAnalyticsTabs, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, WATCHER_HIDDEN_REPORTS, canViewPlatformAuditLogs, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, chatInputSliceActions, removeFile, WithFormPermissions, MENTOR_VISIBILITY } from '@iblai/web-utils';
|
|
5
5
|
import * as dataLayer from '@iblai/data-layer';
|
|
6
|
-
import { useCreateSessionIdMutation, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetMentorPublicSettingsQuery, useGetReportsQuery, useCreateReportMutation, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useGetMentorMemoriesListQuery, useGetMentorMemoriesQuery, useGetMemoryCategoriesAdminQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, resolveEffectiveAgentSkills, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetApplicationStatusQuery, useListOwnApplicationsQuery, useGetApplicationFormQuery, useWithdrawApplicationMutation, useRenewApplicationMutation, useCreateApplicationDraftMutation, useSubmitApplicationMutation, useUpdateApplicationMutation, useUploadApplicationAttachmentMutation, useDeleteApplicationAttachmentMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
|
|
6
|
+
import { useCreateSessionIdMutation, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetMentorPublicSettingsQuery, useGetReportsQuery, useCreateReportMutation, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useGetPlatformAuditLogsQuery, PLATFORM_AUDIT_EVENT_TYPES, PLATFORM_AUDIT_ACTION_CODES, useGetMentorMemoriesListQuery, useGetMentorMemoriesQuery, useGetMemoryCategoriesAdminQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, resolveEffectiveAgentSkills, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetApplicationStatusQuery, useListOwnApplicationsQuery, useGetApplicationFormQuery, useWithdrawApplicationMutation, useRenewApplicationMutation, useCreateApplicationDraftMutation, useSubmitApplicationMutation, useUpdateApplicationMutation, useUploadApplicationAttachmentMutation, useDeleteApplicationAttachmentMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
|
|
7
7
|
import { toast } from 'sonner';
|
|
8
8
|
import { jsx, Fragment as Fragment$1, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
import * as ReactDOM from 'react-dom';
|
|
@@ -45577,7 +45577,7 @@ var isArray$f = function isArray(arr) {
|
|
|
45577
45577
|
return toStr.call(arr) === '[object Array]';
|
|
45578
45578
|
};
|
|
45579
45579
|
|
|
45580
|
-
var isPlainObject$
|
|
45580
|
+
var isPlainObject$5 = function isPlainObject(obj) {
|
|
45581
45581
|
if (!obj || toStr.call(obj) !== '[object Object]') {
|
|
45582
45582
|
return false;
|
|
45583
45583
|
}
|
|
@@ -45656,12 +45656,12 @@ var extend$3 = function extend() {
|
|
|
45656
45656
|
// Prevent never-ending loop
|
|
45657
45657
|
if (target !== copy) {
|
|
45658
45658
|
// Recurse if we're merging plain objects or arrays
|
|
45659
|
-
if (deep && copy && (isPlainObject$
|
|
45659
|
+
if (deep && copy && (isPlainObject$5(copy) || (copyIsArray = isArray$f(copy)))) {
|
|
45660
45660
|
if (copyIsArray) {
|
|
45661
45661
|
copyIsArray = false;
|
|
45662
45662
|
clone = src && isArray$f(src) ? src : [];
|
|
45663
45663
|
} else {
|
|
45664
|
-
clone = src && isPlainObject$
|
|
45664
|
+
clone = src && isPlainObject$5(src) ? src : {};
|
|
45665
45665
|
}
|
|
45666
45666
|
|
|
45667
45667
|
// Never move original objects, clone them
|
|
@@ -45682,7 +45682,7 @@ var extend$3 = function extend() {
|
|
|
45682
45682
|
|
|
45683
45683
|
var extend$2 = /*@__PURE__*/getDefaultExportFromCjs(extend$3);
|
|
45684
45684
|
|
|
45685
|
-
function isPlainObject$
|
|
45685
|
+
function isPlainObject$4(value) {
|
|
45686
45686
|
if (typeof value !== 'object' || value === null) {
|
|
45687
45687
|
return false;
|
|
45688
45688
|
}
|
|
@@ -46753,7 +46753,7 @@ class Processor extends CallableInstance {
|
|
|
46753
46753
|
else if (parameters.length > 0) {
|
|
46754
46754
|
let [primary, ...rest] = parameters;
|
|
46755
46755
|
const currentPrimary = attachers[entryIndex][1];
|
|
46756
|
-
if (isPlainObject$
|
|
46756
|
+
if (isPlainObject$4(currentPrimary) && isPlainObject$4(primary)) {
|
|
46757
46757
|
primary = extend$2(true, currentPrimary, primary);
|
|
46758
46758
|
}
|
|
46759
46759
|
|
|
@@ -46845,7 +46845,7 @@ function assertUnfrozen(name, frozen) {
|
|
|
46845
46845
|
function assertNode(node) {
|
|
46846
46846
|
// `isPlainObj` unfortunately uses `any` instead of `unknown`.
|
|
46847
46847
|
// type-coverage:ignore-next-line
|
|
46848
|
-
if (!isPlainObject$
|
|
46848
|
+
if (!isPlainObject$4(node) || typeof node.type !== 'string') {
|
|
46849
46849
|
throw new TypeError('Expected node, got `' + node + '`')
|
|
46850
46850
|
// Fine.
|
|
46851
46851
|
}
|
|
@@ -60562,6 +60562,10 @@ var analyticsAccessTimeHeatmap$3 = {
|
|
|
60562
60562
|
tooltipActiveUsers: "{count} active users"
|
|
60563
60563
|
};
|
|
60564
60564
|
var analyticsAnalyticsAuditLogStats$3 = {
|
|
60565
|
+
scopeAgent: "Agent",
|
|
60566
|
+
scopePlatform: "Platform",
|
|
60567
|
+
scopeAgentHint: "Configuration changes for this agent.",
|
|
60568
|
+
scopePlatformHint: "Platform-wide changes and security events.",
|
|
60565
60569
|
noPermission: "You do not have permission to view audit logs.",
|
|
60566
60570
|
searchForUser: "Search for User",
|
|
60567
60571
|
searchUserPlaceholder: "Search user...",
|
|
@@ -65712,9 +65716,9 @@ var profileApplicationsTab$3 = {
|
|
|
65712
65716
|
linkCopied: "Copied",
|
|
65713
65717
|
formsHeading: "Application forms",
|
|
65714
65718
|
formsDescription: "Every application form of this platform. One form is the default applicants land on.",
|
|
65715
|
-
blockedUsers: "Blocked
|
|
65719
|
+
blockedUsers: "Blocked Users",
|
|
65716
65720
|
blockedUsersDescription: "Families barred from reapplying. Unblocking lets them apply again.",
|
|
65717
|
-
allSubmissions: "All
|
|
65721
|
+
allSubmissions: "All Submissions ({count})",
|
|
65718
65722
|
newForm: "New form",
|
|
65719
65723
|
postApproval_enrolled: "Enrolled",
|
|
65720
65724
|
postApproval_enrollment_in_progress: "Enrollment in progress",
|
|
@@ -65732,7 +65736,7 @@ var profileApplicationsTab$3 = {
|
|
|
65732
65736
|
noForms: "No application forms yet. Create one to turn on applications.",
|
|
65733
65737
|
backToForms: "Back to forms",
|
|
65734
65738
|
submissionsFor: "Submissions — {form}",
|
|
65735
|
-
allSubmissionsHeading: "All
|
|
65739
|
+
allSubmissionsHeading: "All Submissions",
|
|
65736
65740
|
candidateFilterPlaceholder: "Student filter, e.g. grade=6",
|
|
65737
65741
|
sortLabel: "Sort",
|
|
65738
65742
|
sortNewest: "Newest first",
|
|
@@ -66065,6 +66069,81 @@ var graderTabLabels$3 = {
|
|
|
66065
66069
|
overrideButtonAria: "Override grade for {email}"
|
|
66066
66070
|
}
|
|
66067
66071
|
};
|
|
66072
|
+
var analyticsAnalyticsPlatformAuditLog$3 = {
|
|
66073
|
+
eventTypeLabel: "Event type",
|
|
66074
|
+
allEventTypes: "All Event Types",
|
|
66075
|
+
actionLabel: "Action",
|
|
66076
|
+
allActions: "All Actions",
|
|
66077
|
+
actorUsernameLabel: "Actor username",
|
|
66078
|
+
actorUsernamePlaceholder: "Filter by username",
|
|
66079
|
+
actorEmailLabel: "Actor email",
|
|
66080
|
+
actorEmailPlaceholder: "Filter by email",
|
|
66081
|
+
pickDateRange: "Pick a Date Range",
|
|
66082
|
+
clearFilters: "Clear filters",
|
|
66083
|
+
narrowSuggestion: "{count} entries match. Narrow the date range to review them without paging through everything.",
|
|
66084
|
+
colTimestamp: "TIMESTAMP ({timezone})",
|
|
66085
|
+
colEvent: "EVENT / ACTION",
|
|
66086
|
+
colActor: "ACTOR",
|
|
66087
|
+
colResource: "RESOURCE",
|
|
66088
|
+
colIpAddress: "IP ADDRESS",
|
|
66089
|
+
colDetails: "Details",
|
|
66090
|
+
kindModelChange: "Model change",
|
|
66091
|
+
kindEvent: "Security event",
|
|
66092
|
+
viewDetails: "View",
|
|
66093
|
+
notAvailable: "—",
|
|
66094
|
+
loadError: "An error occurred while loading audit logs.",
|
|
66095
|
+
noEntries: "No audit log entries have been recorded for this platform yet.",
|
|
66096
|
+
noFilteredEntries: "No audit log entries match these filters.",
|
|
66097
|
+
forbiddenTitle: "You do not have permission to view platform audit logs.",
|
|
66098
|
+
forbiddenBody: "Ask a platform administrator to grant you audit log access.",
|
|
66099
|
+
resultSummary: "Showing {shown} of {total} entries."
|
|
66100
|
+
};
|
|
66101
|
+
var analyticsPlatformAuditLogDetailSheet$3 = {
|
|
66102
|
+
title: "Audit entry",
|
|
66103
|
+
description: "Read-only detail for this audit log entry.",
|
|
66104
|
+
timestamp: "Timestamp",
|
|
66105
|
+
event: "Event",
|
|
66106
|
+
action: "Action",
|
|
66107
|
+
actor: "Actor",
|
|
66108
|
+
resource: "Resource",
|
|
66109
|
+
ipAddress: "IP address",
|
|
66110
|
+
entryId: "Entry ID",
|
|
66111
|
+
changesHeading: "Changes",
|
|
66112
|
+
metadataHeading: "Metadata",
|
|
66113
|
+
noMetadata: "This event carries no metadata.",
|
|
66114
|
+
notAvailable: "—"
|
|
66115
|
+
};
|
|
66116
|
+
var analyticsAuditLogJsonView$3 = {
|
|
66117
|
+
"null": "null",
|
|
66118
|
+
empty: "(empty)",
|
|
66119
|
+
emptyString: "(empty string)",
|
|
66120
|
+
emptyList: "(empty list)",
|
|
66121
|
+
emptyObject: "(empty object)",
|
|
66122
|
+
truncated: "(nested too deeply to display)",
|
|
66123
|
+
itemCount: "{count, plural, one {# item} other {# items}}",
|
|
66124
|
+
keyCount: "{count, plural, one {# key} other {# keys}}",
|
|
66125
|
+
noPayload: "No additional data recorded.",
|
|
66126
|
+
noChanges: "No field changes recorded.",
|
|
66127
|
+
fieldColumn: "Field",
|
|
66128
|
+
beforeColumn: "Before",
|
|
66129
|
+
afterColumn: "After"
|
|
66130
|
+
};
|
|
66131
|
+
var analyticsUsePlatformAuditLabels$3 = {
|
|
66132
|
+
eventTypeLogin: "Login",
|
|
66133
|
+
eventTypeLogout: "Logout",
|
|
66134
|
+
eventTypeLoginFailed: "Failed login",
|
|
66135
|
+
eventTypePasswordChange: "Password change",
|
|
66136
|
+
eventTypeExport: "Export",
|
|
66137
|
+
eventTypeDownloadFile: "File download",
|
|
66138
|
+
eventTypeApiCall: "API call",
|
|
66139
|
+
eventTypeViewStudentRecord: "Student record viewed",
|
|
66140
|
+
eventTypeChangeGrade: "Grade change",
|
|
66141
|
+
eventTypeAdminAction: "Admin action",
|
|
66142
|
+
actionCreate: "Create",
|
|
66143
|
+
actionUpdate: "Update",
|
|
66144
|
+
actionDelete: "Delete",
|
|
66145
|
+
actionAccess: "Access"
|
|
66146
|
+
};
|
|
66068
66147
|
var en = {
|
|
66069
66148
|
accessTabAddAccess: accessTabAddAccess$3,
|
|
66070
66149
|
accessTabLabels: accessTabLabels$3,
|
|
@@ -66322,7 +66401,11 @@ var en = {
|
|
|
66322
66401
|
applyApplyWizard: applyApplyWizard$3,
|
|
66323
66402
|
profileApplicationsTab: profileApplicationsTab$3,
|
|
66324
66403
|
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$3,
|
|
66325
|
-
graderTabLabels: graderTabLabels$3
|
|
66404
|
+
graderTabLabels: graderTabLabels$3,
|
|
66405
|
+
analyticsAnalyticsPlatformAuditLog: analyticsAnalyticsPlatformAuditLog$3,
|
|
66406
|
+
analyticsPlatformAuditLogDetailSheet: analyticsPlatformAuditLogDetailSheet$3,
|
|
66407
|
+
analyticsAuditLogJsonView: analyticsAuditLogJsonView$3,
|
|
66408
|
+
analyticsUsePlatformAuditLabels: analyticsUsePlatformAuditLabels$3
|
|
66326
66409
|
};
|
|
66327
66410
|
|
|
66328
66411
|
var accessTabAddAccess$2 = {
|
|
@@ -66943,6 +67026,10 @@ var analyticsAccessTimeHeatmap$2 = {
|
|
|
66943
67026
|
tooltipActiveUsers: "{count} utilisateurs actifs"
|
|
66944
67027
|
};
|
|
66945
67028
|
var analyticsAnalyticsAuditLogStats$2 = {
|
|
67029
|
+
scopeAgent: "Agent",
|
|
67030
|
+
scopePlatform: "Plateforme",
|
|
67031
|
+
scopeAgentHint: "Modifications de configuration de cet agent.",
|
|
67032
|
+
scopePlatformHint: "Modifications et événements de sécurité de la plateforme.",
|
|
66946
67033
|
noPermission: "Vous n'avez pas la permission de consulter les journaux d'audit.",
|
|
66947
67034
|
searchForUser: "Rechercher un utilisateur",
|
|
66948
67035
|
searchUserPlaceholder: "Rechercher un utilisateur...",
|
|
@@ -72446,6 +72533,81 @@ var skillsTabLabels$2 = {
|
|
|
72446
72533
|
notBaseAgent: "Les compétences ne sont disponibles que pour les agents de base.",
|
|
72447
72534
|
loading: "Chargement..."
|
|
72448
72535
|
};
|
|
72536
|
+
var analyticsAnalyticsPlatformAuditLog$2 = {
|
|
72537
|
+
eventTypeLabel: "Type d'événement",
|
|
72538
|
+
allEventTypes: "Tous les types d'événement",
|
|
72539
|
+
actionLabel: "Action",
|
|
72540
|
+
allActions: "Toutes les actions",
|
|
72541
|
+
actorUsernameLabel: "Nom d'utilisateur de l'auteur",
|
|
72542
|
+
actorUsernamePlaceholder: "Filtrer par nom d'utilisateur",
|
|
72543
|
+
actorEmailLabel: "E-mail de l'auteur",
|
|
72544
|
+
actorEmailPlaceholder: "Filtrer par e-mail",
|
|
72545
|
+
pickDateRange: "Choisir une période",
|
|
72546
|
+
clearFilters: "Effacer les filtres",
|
|
72547
|
+
narrowSuggestion: "{count} entrées correspondent. Restreignez la période pour les consulter sans parcourir toutes les pages.",
|
|
72548
|
+
colTimestamp: "HORODATAGE ({timezone})",
|
|
72549
|
+
colEvent: "ÉVÉNEMENT / ACTION",
|
|
72550
|
+
colActor: "AUTEUR",
|
|
72551
|
+
colResource: "RESSOURCE",
|
|
72552
|
+
colIpAddress: "ADRESSE IP",
|
|
72553
|
+
colDetails: "Détails",
|
|
72554
|
+
kindModelChange: "Modification de modèle",
|
|
72555
|
+
kindEvent: "Événement de sécurité",
|
|
72556
|
+
viewDetails: "Voir",
|
|
72557
|
+
notAvailable: "—",
|
|
72558
|
+
loadError: "Une erreur s'est produite lors du chargement des journaux d'audit.",
|
|
72559
|
+
noEntries: "Aucune entrée d'audit n'a encore été enregistrée pour cette plateforme.",
|
|
72560
|
+
noFilteredEntries: "Aucune entrée d'audit ne correspond à ces filtres.",
|
|
72561
|
+
forbiddenTitle: "Vous n'avez pas l'autorisation de consulter les journaux d'audit de la plateforme.",
|
|
72562
|
+
forbiddenBody: "Demandez à un administrateur de la plateforme de vous accorder l'accès aux journaux d'audit.",
|
|
72563
|
+
resultSummary: "Affichage de {shown} entrées sur {total}."
|
|
72564
|
+
};
|
|
72565
|
+
var analyticsPlatformAuditLogDetailSheet$2 = {
|
|
72566
|
+
title: "Entrée d'audit",
|
|
72567
|
+
description: "Détail en lecture seule de cette entrée d'audit.",
|
|
72568
|
+
timestamp: "Horodatage",
|
|
72569
|
+
event: "Événement",
|
|
72570
|
+
action: "Action",
|
|
72571
|
+
actor: "Auteur",
|
|
72572
|
+
resource: "Ressource",
|
|
72573
|
+
ipAddress: "Adresse IP",
|
|
72574
|
+
entryId: "ID de l'entrée",
|
|
72575
|
+
changesHeading: "Modifications",
|
|
72576
|
+
metadataHeading: "Métadonnées",
|
|
72577
|
+
noMetadata: "Cet événement ne contient aucune métadonnée.",
|
|
72578
|
+
notAvailable: "—"
|
|
72579
|
+
};
|
|
72580
|
+
var analyticsAuditLogJsonView$2 = {
|
|
72581
|
+
"null": "null",
|
|
72582
|
+
empty: "(vide)",
|
|
72583
|
+
emptyString: "(chaîne vide)",
|
|
72584
|
+
emptyList: "(liste vide)",
|
|
72585
|
+
emptyObject: "(objet vide)",
|
|
72586
|
+
truncated: "(trop imbriqué pour être affiché)",
|
|
72587
|
+
itemCount: "{count, plural, one {# élément} other {# éléments}}",
|
|
72588
|
+
keyCount: "{count, plural, one {# clé} other {# clés}}",
|
|
72589
|
+
noPayload: "Aucune donnée supplémentaire enregistrée.",
|
|
72590
|
+
noChanges: "Aucune modification de champ enregistrée.",
|
|
72591
|
+
fieldColumn: "Champ",
|
|
72592
|
+
beforeColumn: "Avant",
|
|
72593
|
+
afterColumn: "Après"
|
|
72594
|
+
};
|
|
72595
|
+
var analyticsUsePlatformAuditLabels$2 = {
|
|
72596
|
+
eventTypeLogin: "Connexion",
|
|
72597
|
+
eventTypeLogout: "Déconnexion",
|
|
72598
|
+
eventTypeLoginFailed: "Échec de connexion",
|
|
72599
|
+
eventTypePasswordChange: "Changement de mot de passe",
|
|
72600
|
+
eventTypeExport: "Exportation",
|
|
72601
|
+
eventTypeDownloadFile: "Téléchargement de fichier",
|
|
72602
|
+
eventTypeApiCall: "Appel d'API",
|
|
72603
|
+
eventTypeViewStudentRecord: "Dossier étudiant consulté",
|
|
72604
|
+
eventTypeChangeGrade: "Modification de note",
|
|
72605
|
+
eventTypeAdminAction: "Action d'administration",
|
|
72606
|
+
actionCreate: "Créer",
|
|
72607
|
+
actionUpdate: "Mettre à jour",
|
|
72608
|
+
actionDelete: "Supprimer",
|
|
72609
|
+
actionAccess: "Accéder"
|
|
72610
|
+
};
|
|
72449
72611
|
var fr = {
|
|
72450
72612
|
accessTabAddAccess: accessTabAddAccess$2,
|
|
72451
72613
|
accessTabLabels: accessTabLabels$2,
|
|
@@ -72703,7 +72865,11 @@ var fr = {
|
|
|
72703
72865
|
profileApplicationsTab: profileApplicationsTab$2,
|
|
72704
72866
|
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$2,
|
|
72705
72867
|
slashSkillPicker: slashSkillPicker$2,
|
|
72706
|
-
skillsTabLabels: skillsTabLabels$2
|
|
72868
|
+
skillsTabLabels: skillsTabLabels$2,
|
|
72869
|
+
analyticsAnalyticsPlatformAuditLog: analyticsAnalyticsPlatformAuditLog$2,
|
|
72870
|
+
analyticsPlatformAuditLogDetailSheet: analyticsPlatformAuditLogDetailSheet$2,
|
|
72871
|
+
analyticsAuditLogJsonView: analyticsAuditLogJsonView$2,
|
|
72872
|
+
analyticsUsePlatformAuditLabels: analyticsUsePlatformAuditLabels$2
|
|
72707
72873
|
};
|
|
72708
72874
|
|
|
72709
72875
|
var accessTabAddAccess$1 = {
|
|
@@ -73324,6 +73490,10 @@ var analyticsAccessTimeHeatmap$1 = {
|
|
|
73324
73490
|
tooltipActiveUsers: "{count} usuarios activos"
|
|
73325
73491
|
};
|
|
73326
73492
|
var analyticsAnalyticsAuditLogStats$1 = {
|
|
73493
|
+
scopeAgent: "Agente",
|
|
73494
|
+
scopePlatform: "Plataforma",
|
|
73495
|
+
scopeAgentHint: "Cambios de configuración de este agente.",
|
|
73496
|
+
scopePlatformHint: "Cambios y eventos de seguridad de toda la plataforma.",
|
|
73327
73497
|
noPermission: "No tienes permiso para ver los registros de auditoría.",
|
|
73328
73498
|
searchForUser: "Buscar usuario",
|
|
73329
73499
|
searchUserPlaceholder: "Buscar usuario...",
|
|
@@ -78827,6 +78997,81 @@ var skillsTabLabels$1 = {
|
|
|
78827
78997
|
notBaseAgent: "Las habilidades solo están disponibles para los agentes base.",
|
|
78828
78998
|
loading: "Cargando..."
|
|
78829
78999
|
};
|
|
79000
|
+
var analyticsAnalyticsPlatformAuditLog$1 = {
|
|
79001
|
+
eventTypeLabel: "Tipo de evento",
|
|
79002
|
+
allEventTypes: "Todos los tipos de evento",
|
|
79003
|
+
actionLabel: "Acción",
|
|
79004
|
+
allActions: "Todas las acciones",
|
|
79005
|
+
actorUsernameLabel: "Nombre de usuario del actor",
|
|
79006
|
+
actorUsernamePlaceholder: "Filtrar por nombre de usuario",
|
|
79007
|
+
actorEmailLabel: "Correo del actor",
|
|
79008
|
+
actorEmailPlaceholder: "Filtrar por correo",
|
|
79009
|
+
pickDateRange: "Elige un rango de fechas",
|
|
79010
|
+
clearFilters: "Borrar filtros",
|
|
79011
|
+
narrowSuggestion: "{count} registros coinciden. Acota el rango de fechas para revisarlos sin recorrer todas las páginas.",
|
|
79012
|
+
colTimestamp: "FECHA Y HORA ({timezone})",
|
|
79013
|
+
colEvent: "EVENTO / ACCIÓN",
|
|
79014
|
+
colActor: "ACTOR",
|
|
79015
|
+
colResource: "RECURSO",
|
|
79016
|
+
colIpAddress: "DIRECCIÓN IP",
|
|
79017
|
+
colDetails: "Detalles",
|
|
79018
|
+
kindModelChange: "Cambio de modelo",
|
|
79019
|
+
kindEvent: "Evento de seguridad",
|
|
79020
|
+
viewDetails: "Ver",
|
|
79021
|
+
notAvailable: "—",
|
|
79022
|
+
loadError: "Se produjo un error al cargar los registros de auditoría.",
|
|
79023
|
+
noEntries: "Todavía no se han registrado entradas de auditoría para esta plataforma.",
|
|
79024
|
+
noFilteredEntries: "Ninguna entrada de auditoría coincide con estos filtros.",
|
|
79025
|
+
forbiddenTitle: "No tienes permiso para ver los registros de auditoría de la plataforma.",
|
|
79026
|
+
forbiddenBody: "Pide a un administrador de la plataforma que te dé acceso a los registros de auditoría.",
|
|
79027
|
+
resultSummary: "Mostrando {shown} de {total} entradas."
|
|
79028
|
+
};
|
|
79029
|
+
var analyticsPlatformAuditLogDetailSheet$1 = {
|
|
79030
|
+
title: "Entrada de auditoría",
|
|
79031
|
+
description: "Detalle de solo lectura de esta entrada de auditoría.",
|
|
79032
|
+
timestamp: "Fecha y hora",
|
|
79033
|
+
event: "Evento",
|
|
79034
|
+
action: "Acción",
|
|
79035
|
+
actor: "Actor",
|
|
79036
|
+
resource: "Recurso",
|
|
79037
|
+
ipAddress: "Dirección IP",
|
|
79038
|
+
entryId: "ID de entrada",
|
|
79039
|
+
changesHeading: "Cambios",
|
|
79040
|
+
metadataHeading: "Metadatos",
|
|
79041
|
+
noMetadata: "Este evento no incluye metadatos.",
|
|
79042
|
+
notAvailable: "—"
|
|
79043
|
+
};
|
|
79044
|
+
var analyticsAuditLogJsonView$1 = {
|
|
79045
|
+
"null": "null",
|
|
79046
|
+
empty: "(vacío)",
|
|
79047
|
+
emptyString: "(cadena vacía)",
|
|
79048
|
+
emptyList: "(lista vacía)",
|
|
79049
|
+
emptyObject: "(objeto vacío)",
|
|
79050
|
+
truncated: "(demasiado anidado para mostrarlo)",
|
|
79051
|
+
itemCount: "{count, plural, one {# elemento} other {# elementos}}",
|
|
79052
|
+
keyCount: "{count, plural, one {# clave} other {# claves}}",
|
|
79053
|
+
noPayload: "No se registraron datos adicionales.",
|
|
79054
|
+
noChanges: "No se registraron cambios de campos.",
|
|
79055
|
+
fieldColumn: "Campo",
|
|
79056
|
+
beforeColumn: "Antes",
|
|
79057
|
+
afterColumn: "Después"
|
|
79058
|
+
};
|
|
79059
|
+
var analyticsUsePlatformAuditLabels$1 = {
|
|
79060
|
+
eventTypeLogin: "Inicio de sesión",
|
|
79061
|
+
eventTypeLogout: "Cierre de sesión",
|
|
79062
|
+
eventTypeLoginFailed: "Inicio de sesión fallido",
|
|
79063
|
+
eventTypePasswordChange: "Cambio de contraseña",
|
|
79064
|
+
eventTypeExport: "Exportación",
|
|
79065
|
+
eventTypeDownloadFile: "Descarga de archivo",
|
|
79066
|
+
eventTypeApiCall: "Llamada a la API",
|
|
79067
|
+
eventTypeViewStudentRecord: "Expediente de estudiante consultado",
|
|
79068
|
+
eventTypeChangeGrade: "Cambio de calificación",
|
|
79069
|
+
eventTypeAdminAction: "Acción de administrador",
|
|
79070
|
+
actionCreate: "Crear",
|
|
79071
|
+
actionUpdate: "Actualizar",
|
|
79072
|
+
actionDelete: "Eliminar",
|
|
79073
|
+
actionAccess: "Acceder"
|
|
79074
|
+
};
|
|
78830
79075
|
var es = {
|
|
78831
79076
|
accessTabAddAccess: accessTabAddAccess$1,
|
|
78832
79077
|
accessTabLabels: accessTabLabels$1,
|
|
@@ -79084,7 +79329,11 @@ var es = {
|
|
|
79084
79329
|
profileApplicationsTab: profileApplicationsTab$1,
|
|
79085
79330
|
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$1,
|
|
79086
79331
|
slashSkillPicker: slashSkillPicker$1,
|
|
79087
|
-
skillsTabLabels: skillsTabLabels$1
|
|
79332
|
+
skillsTabLabels: skillsTabLabels$1,
|
|
79333
|
+
analyticsAnalyticsPlatformAuditLog: analyticsAnalyticsPlatformAuditLog$1,
|
|
79334
|
+
analyticsPlatformAuditLogDetailSheet: analyticsPlatformAuditLogDetailSheet$1,
|
|
79335
|
+
analyticsAuditLogJsonView: analyticsAuditLogJsonView$1,
|
|
79336
|
+
analyticsUsePlatformAuditLabels: analyticsUsePlatformAuditLabels$1
|
|
79088
79337
|
};
|
|
79089
79338
|
|
|
79090
79339
|
var accessTabAddAccess = {
|
|
@@ -79705,6 +79954,10 @@ var analyticsAccessTimeHeatmap = {
|
|
|
79705
79954
|
tooltipActiveUsers: "{count} 位活跃用户"
|
|
79706
79955
|
};
|
|
79707
79956
|
var analyticsAnalyticsAuditLogStats = {
|
|
79957
|
+
scopeAgent: "智能体",
|
|
79958
|
+
scopePlatform: "平台",
|
|
79959
|
+
scopeAgentHint: "此智能体的配置变更。",
|
|
79960
|
+
scopePlatformHint: "全平台的变更与安全事件。",
|
|
79708
79961
|
noPermission: "您没有查看审计日志的权限。",
|
|
79709
79962
|
searchForUser: "搜索用户",
|
|
79710
79963
|
searchUserPlaceholder: "搜索用户...",
|
|
@@ -85208,6 +85461,81 @@ var skillsTabLabels = {
|
|
|
85208
85461
|
notBaseAgent: "技能仅适用于基础智能体。",
|
|
85209
85462
|
loading: "加载中..."
|
|
85210
85463
|
};
|
|
85464
|
+
var analyticsAnalyticsPlatformAuditLog = {
|
|
85465
|
+
eventTypeLabel: "事件类型",
|
|
85466
|
+
allEventTypes: "所有事件类型",
|
|
85467
|
+
actionLabel: "操作",
|
|
85468
|
+
allActions: "所有操作",
|
|
85469
|
+
actorUsernameLabel: "操作者用户名",
|
|
85470
|
+
actorUsernamePlaceholder: "按用户名筛选",
|
|
85471
|
+
actorEmailLabel: "操作者邮箱",
|
|
85472
|
+
actorEmailPlaceholder: "按邮箱筛选",
|
|
85473
|
+
pickDateRange: "选择日期范围",
|
|
85474
|
+
clearFilters: "清除筛选",
|
|
85475
|
+
narrowSuggestion: "共有 {count} 条记录匹配。缩小日期范围可避免逐页翻阅。",
|
|
85476
|
+
colTimestamp: "时间 ({timezone})",
|
|
85477
|
+
colEvent: "事件 / 操作",
|
|
85478
|
+
colActor: "操作者",
|
|
85479
|
+
colResource: "资源",
|
|
85480
|
+
colIpAddress: "IP 地址",
|
|
85481
|
+
colDetails: "详情",
|
|
85482
|
+
kindModelChange: "数据变更",
|
|
85483
|
+
kindEvent: "安全事件",
|
|
85484
|
+
viewDetails: "查看",
|
|
85485
|
+
notAvailable: "—",
|
|
85486
|
+
loadError: "加载审计日志时出错。",
|
|
85487
|
+
noEntries: "该平台尚未记录任何审计日志。",
|
|
85488
|
+
noFilteredEntries: "没有符合这些筛选条件的审计日志。",
|
|
85489
|
+
forbiddenTitle: "您没有查看平台审计日志的权限。",
|
|
85490
|
+
forbiddenBody: "请联系平台管理员为您开通审计日志访问权限。",
|
|
85491
|
+
resultSummary: "显示 {total} 条中的 {shown} 条。"
|
|
85492
|
+
};
|
|
85493
|
+
var analyticsPlatformAuditLogDetailSheet = {
|
|
85494
|
+
title: "审计记录",
|
|
85495
|
+
description: "该审计日志记录的只读详情。",
|
|
85496
|
+
timestamp: "时间",
|
|
85497
|
+
event: "事件",
|
|
85498
|
+
action: "操作",
|
|
85499
|
+
actor: "操作者",
|
|
85500
|
+
resource: "资源",
|
|
85501
|
+
ipAddress: "IP 地址",
|
|
85502
|
+
entryId: "记录 ID",
|
|
85503
|
+
changesHeading: "变更内容",
|
|
85504
|
+
metadataHeading: "元数据",
|
|
85505
|
+
noMetadata: "该事件没有元数据。",
|
|
85506
|
+
notAvailable: "—"
|
|
85507
|
+
};
|
|
85508
|
+
var analyticsAuditLogJsonView = {
|
|
85509
|
+
"null": "null",
|
|
85510
|
+
empty: "(空)",
|
|
85511
|
+
emptyString: "(空字符串)",
|
|
85512
|
+
emptyList: "(空列表)",
|
|
85513
|
+
emptyObject: "(空对象)",
|
|
85514
|
+
truncated: "(嵌套层级过深,无法显示)",
|
|
85515
|
+
itemCount: "{count} 项",
|
|
85516
|
+
keyCount: "{count} 个键",
|
|
85517
|
+
noPayload: "没有记录额外数据。",
|
|
85518
|
+
noChanges: "没有记录字段变更。",
|
|
85519
|
+
fieldColumn: "字段",
|
|
85520
|
+
beforeColumn: "变更前",
|
|
85521
|
+
afterColumn: "变更后"
|
|
85522
|
+
};
|
|
85523
|
+
var analyticsUsePlatformAuditLabels = {
|
|
85524
|
+
eventTypeLogin: "登录",
|
|
85525
|
+
eventTypeLogout: "登出",
|
|
85526
|
+
eventTypeLoginFailed: "登录失败",
|
|
85527
|
+
eventTypePasswordChange: "修改密码",
|
|
85528
|
+
eventTypeExport: "导出",
|
|
85529
|
+
eventTypeDownloadFile: "文件下载",
|
|
85530
|
+
eventTypeApiCall: "API 调用",
|
|
85531
|
+
eventTypeViewStudentRecord: "查看学生记录",
|
|
85532
|
+
eventTypeChangeGrade: "成绩变更",
|
|
85533
|
+
eventTypeAdminAction: "管理员操作",
|
|
85534
|
+
actionCreate: "创建",
|
|
85535
|
+
actionUpdate: "更新",
|
|
85536
|
+
actionDelete: "删除",
|
|
85537
|
+
actionAccess: "访问"
|
|
85538
|
+
};
|
|
85211
85539
|
var zh = {
|
|
85212
85540
|
accessTabAddAccess: accessTabAddAccess,
|
|
85213
85541
|
accessTabLabels: accessTabLabels,
|
|
@@ -85465,7 +85793,11 @@ var zh = {
|
|
|
85465
85793
|
profileApplicationsTab: profileApplicationsTab,
|
|
85466
85794
|
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor,
|
|
85467
85795
|
slashSkillPicker: slashSkillPicker,
|
|
85468
|
-
skillsTabLabels: skillsTabLabels
|
|
85796
|
+
skillsTabLabels: skillsTabLabels,
|
|
85797
|
+
analyticsAnalyticsPlatformAuditLog: analyticsAnalyticsPlatformAuditLog,
|
|
85798
|
+
analyticsPlatformAuditLogDetailSheet: analyticsPlatformAuditLogDetailSheet,
|
|
85799
|
+
analyticsAuditLogJsonView: analyticsAuditLogJsonView,
|
|
85800
|
+
analyticsUsePlatformAuditLabels: analyticsUsePlatformAuditLabels
|
|
85469
85801
|
};
|
|
85470
85802
|
|
|
85471
85803
|
/**
|
|
@@ -134083,7 +134415,7 @@ var objectCtorString = funcToString.call(Object);
|
|
|
134083
134415
|
* _.isPlainObject(Object.create(null));
|
|
134084
134416
|
* // => true
|
|
134085
134417
|
*/
|
|
134086
|
-
function isPlainObject$
|
|
134418
|
+
function isPlainObject$3(value) {
|
|
134087
134419
|
if (!isObjectLike$1(value) || baseGetTag$1(value) != objectTag) {
|
|
134088
134420
|
return false;
|
|
134089
134421
|
}
|
|
@@ -134096,9 +134428,9 @@ function isPlainObject$2(value) {
|
|
|
134096
134428
|
funcToString.call(Ctor) == objectCtorString;
|
|
134097
134429
|
}
|
|
134098
134430
|
|
|
134099
|
-
var isPlainObject_1 = isPlainObject$
|
|
134431
|
+
var isPlainObject_1 = isPlainObject$3;
|
|
134100
134432
|
|
|
134101
|
-
var isPlainObject$
|
|
134433
|
+
var isPlainObject$2 = /*@__PURE__*/getDefaultExportFromCjs(isPlainObject_1);
|
|
134102
134434
|
|
|
134103
134435
|
var baseGetTag = _baseGetTag,
|
|
134104
134436
|
isObjectLike = isObjectLike_1;
|
|
@@ -134315,7 +134647,7 @@ function Shape(_ref2) {
|
|
|
134315
134647
|
shape = /*#__PURE__*/cloneElement(option, _objectSpread$h(_objectSpread$h({}, props), getPropsFromShapeOption(option)));
|
|
134316
134648
|
} else if (isFunction$3(option)) {
|
|
134317
134649
|
shape = option(props);
|
|
134318
|
-
} else if (isPlainObject$
|
|
134650
|
+
} else if (isPlainObject$2(option) && !isBoolean(option)) {
|
|
134319
134651
|
var nextProps = propTransformer(option, props);
|
|
134320
134652
|
shape = /*#__PURE__*/React__default.createElement(ShapeSelector, {
|
|
134321
134653
|
shapeType: shapeType,
|
|
@@ -142031,11 +142363,11 @@ function EnrolledUserProgressModal({ open, onOpenChange, username, userName, ema
|
|
|
142031
142363
|
];
|
|
142032
142364
|
const currentGradePct = fractionToPct((_f = (_e = item === null || item === void 0 ? void 0 : item.edx_progress) === null || _e === void 0 ? void 0 : _e.course_grade) === null || _f === void 0 ? void 0 : _f.percent);
|
|
142033
142365
|
const passingPct = getPassingPct((_h = (_g = item === null || item === void 0 ? void 0 : item.edx_progress) === null || _g === void 0 ? void 0 : _g.grading_policy) === null || _h === void 0 ? void 0 : _h.grade_range);
|
|
142034
|
-
return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsxs(DialogContent, { className: "max-w-2xl max-h-[85vh] overflow-y-auto", "aria-label": "Enrolled user progress", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: userName || username || 'Learner progress' }), jsxs(DialogDescription, { children: [email ? `${email} · ` : '', resolvedName || (isProgram ? 'Program progress' : 'Course progress')] })] }), loading ? (jsx("div", { className: "flex items-center justify-center py-12", children: jsx("div", { className: "text-sm text-gray-500", children: "Loading..." }) })) : !item ? (jsx(EmptyStats, { title: "No progress data available" })) : (jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "relative mx-auto", style: { width: 220, height: 220 }, children: [jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsx(PieChart, { children: jsxs(Pie, { data: pieData, dataKey: "value", cx: "50%", cy: "50%", innerRadius: 75, outerRadius: 100, startAngle: 90, endAngle: -270, stroke: "none", isAnimationActive: false, children: [jsx(Cell, { fill: COMPLETED_COLOR }), jsx(Cell, { fill: REMAINING_COLOR })] }) }) }), jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none", children: [jsxs("span", { className: "text-3xl font-bold text-gray-700", children: [percentage, "%"] }), jsx("span", { className: "text-sm text-gray-500", children: "completed" })] })] }), jsxs("div", { className: "divide-y divide-[oklch(0.922_0_0)]", children: [jsx(DetailRow, { label: "Status", children: jsx("span", { className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${((_j = item.completion) === null || _j === void 0 ? void 0 : _j.passed)
|
|
142366
|
+
return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsxs(DialogContent, { className: "max-w-2xl max-h-[85vh] overflow-y-auto", "aria-label": "Enrolled user progress", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: userName || username || 'Learner progress' }), jsxs(DialogDescription, { children: [email ? `${email} · ` : '', resolvedName || (isProgram ? 'Program progress' : 'Course progress')] })] }), loading ? (jsx("div", { className: "flex items-center justify-center py-12", children: jsx("div", { className: "text-sm text-gray-500", children: "Loading..." }) })) : !item ? (jsx(EmptyStats, { title: "No progress data available" })) : (jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "relative mx-auto", style: { width: 220, height: 220 }, children: [jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsx(PieChart, { children: jsxs(Pie, { data: pieData, dataKey: "value", cx: "50%", cy: "50%", innerRadius: 75, outerRadius: 100, startAngle: 90, endAngle: -270, stroke: "none", isAnimationActive: false, children: [jsx(Cell, { fill: COMPLETED_COLOR }), jsx(Cell, { fill: REMAINING_COLOR })] }) }) }), jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none", children: [jsxs("span", { className: "text-3xl font-bold text-gray-700", children: [percentage, "%"] }), jsx("span", { className: "text-sm text-gray-500", children: "completed" })] })] }), jsxs("div", { className: "divide-y divide-[oklch(0.922_0_0)]", children: [jsx(DetailRow$1, { label: "Status", children: jsx("span", { className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${((_j = item.completion) === null || _j === void 0 ? void 0 : _j.passed)
|
|
142035
142367
|
? 'bg-green-50 text-green-700'
|
|
142036
|
-
: 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow, { label: "Passed on", children: formatDate$2((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow, { label: "Enrollment date", children: formatDate$2((_o = (_m = item.enrollment) === null || _m === void 0 ? void 0 : _m.started) !== null && _o !== void 0 ? _o : (_p = item.enrollment) === null || _p === void 0 ? void 0 : _p.created) })] }), ((_s = (_r = (_q = item.edx_progress) === null || _q === void 0 ? void 0 : _q.grading_policy) === null || _r === void 0 ? void 0 : _r.assignment_policies) === null || _s === void 0 ? void 0 : _s.length) ? (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "rounded-lg border p-4", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grades" }), jsx("p", { className: "text-xs text-gray-500", children: "This represents the weighted grade against the grade needed to pass this course." }), jsx(GradeBar, { currentPct: currentGradePct, passingPct: passingPct })] }), jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-4 py-3", children: [jsx(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), jsxs("span", { className: "text-sm font-medium text-gray-800", children: ["A weighted grade of ", passingPct, "% is required to pass in this course"] })] }), jsxs("div", { className: "rounded-lg border p-4 space-y-3", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grade summary" }), jsx("div", { className: "overflow-x-auto", children: jsxs("table", { className: "w-full border-collapse text-sm", children: [jsx("thead", { children: jsxs("tr", { className: "bg-amber-50 text-[11px] uppercase tracking-wide text-gray-600", children: [jsx("th", { className: "px-3 py-2 text-left font-medium", children: "Assignment type" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weight" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Grade" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weighted grade" })] }) }), jsxs("tbody", { children: [gradeSummary === null || gradeSummary === void 0 ? void 0 : gradeSummary.rows.map((row, index) => (jsxs("tr", { className: index % 2 === 0 ? '' : 'bg-gray-50', children: [jsxs("td", { className: "px-3 py-2 text-gray-800", children: [row.type, row.footnote ? (jsx("sup", { className: "ml-0.5 text-amber-500", children: row.footnote })) : null] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.weightPct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.gradePct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right font-semibold text-amber-600", children: [row.weightedGradePct, "%"] })] }, row.type))), jsxs("tr", { className: "border-l-2 border-amber-400 bg-amber-50", children: [jsx("td", { className: "px-3 py-2 font-medium text-gray-800", colSpan: 3, children: "Current weighted grade summary" }), jsxs("td", { className: "px-3 py-2 text-right font-bold text-amber-600", children: [currentGradePct, "%"] })] })] })] }) }), gradeSummary && gradeSummary.footnotes.length > 0 ? (jsx("div", { className: "space-y-1", children: gradeSummary.footnotes.map((note, index) => (jsxs("p", { className: "text-xs text-gray-500", children: [jsx("sup", { className: "text-amber-500", children: index + 1 }), " ", note] }, note))) })) : null] })] })) : null] }))] }) }));
|
|
142368
|
+
: 'bg-gray-100 text-gray-600'}`, children: ((_k = item.completion) === null || _k === void 0 ? void 0 : _k.passed) ? 'Passed' : 'Not passed' }) }), jsx(DetailRow$1, { label: "Passed on", children: formatDate$2((_l = item.completion) === null || _l === void 0 ? void 0 : _l.passed_date) }), jsx(DetailRow$1, { label: "Time spent", children: item.time_spent || '—' }), jsx(DetailRow$1, { label: "Enrollment date", children: formatDate$2((_o = (_m = item.enrollment) === null || _m === void 0 ? void 0 : _m.started) !== null && _o !== void 0 ? _o : (_p = item.enrollment) === null || _p === void 0 ? void 0 : _p.created) })] }), ((_s = (_r = (_q = item.edx_progress) === null || _q === void 0 ? void 0 : _q.grading_policy) === null || _r === void 0 ? void 0 : _r.assignment_policies) === null || _s === void 0 ? void 0 : _s.length) ? (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "rounded-lg border p-4", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grades" }), jsx("p", { className: "text-xs text-gray-500", children: "This represents the weighted grade against the grade needed to pass this course." }), jsx(GradeBar, { currentPct: currentGradePct, passingPct: passingPct })] }), jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-4 py-3", children: [jsx(TriangleAlert, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), jsxs("span", { className: "text-sm font-medium text-gray-800", children: ["A weighted grade of ", passingPct, "% is required to pass in this course"] })] }), jsxs("div", { className: "rounded-lg border p-4 space-y-3", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("h4", { className: "text-sm font-semibold text-gray-900", children: "Grade summary" }), jsx("div", { className: "overflow-x-auto", children: jsxs("table", { className: "w-full border-collapse text-sm", children: [jsx("thead", { children: jsxs("tr", { className: "bg-amber-50 text-[11px] uppercase tracking-wide text-gray-600", children: [jsx("th", { className: "px-3 py-2 text-left font-medium", children: "Assignment type" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weight" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Grade" }), jsx("th", { className: "px-3 py-2 text-right font-medium", children: "Weighted grade" })] }) }), jsxs("tbody", { children: [gradeSummary === null || gradeSummary === void 0 ? void 0 : gradeSummary.rows.map((row, index) => (jsxs("tr", { className: index % 2 === 0 ? '' : 'bg-gray-50', children: [jsxs("td", { className: "px-3 py-2 text-gray-800", children: [row.type, row.footnote ? (jsx("sup", { className: "ml-0.5 text-amber-500", children: row.footnote })) : null] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.weightPct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right text-gray-700", children: [row.gradePct, "%"] }), jsxs("td", { className: "px-3 py-2 text-right font-semibold text-amber-600", children: [row.weightedGradePct, "%"] })] }, row.type))), jsxs("tr", { className: "border-l-2 border-amber-400 bg-amber-50", children: [jsx("td", { className: "px-3 py-2 font-medium text-gray-800", colSpan: 3, children: "Current weighted grade summary" }), jsxs("td", { className: "px-3 py-2 text-right font-bold text-amber-600", children: [currentGradePct, "%"] })] })] })] }) }), gradeSummary && gradeSummary.footnotes.length > 0 ? (jsx("div", { className: "space-y-1", children: gradeSummary.footnotes.map((note, index) => (jsxs("p", { className: "text-xs text-gray-500", children: [jsx("sup", { className: "text-amber-500", children: index + 1 }), " ", note] }, note))) })) : null] })] })) : null] }))] }) }));
|
|
142037
142369
|
}
|
|
142038
|
-
function DetailRow({ label, children }) {
|
|
142370
|
+
function DetailRow$1({ label, children }) {
|
|
142039
142371
|
return (jsxs("div", { className: "flex items-center justify-between gap-4 py-2", children: [jsx("span", { className: "text-sm text-gray-500", children: label }), jsx("span", { className: "text-sm font-medium text-gray-900 text-right", children: children })] }));
|
|
142040
142372
|
}
|
|
142041
142373
|
|
|
@@ -147738,14 +148070,15 @@ const PAGE_SIZE$3 = 20;
|
|
|
147738
148070
|
const SEARCH_DEBOUNCE_MS$1 = 300;
|
|
147739
148071
|
/**
|
|
147740
148072
|
* The public application URL on the auth SPA for one form of a platform
|
|
147741
|
-
* (`<auth-url>/applications/<platform-key>/<form-id>?
|
|
147742
|
-
* the auth SPA URL cannot be resolved. `authSpaUrl` (prop) wins;
|
|
147743
|
-
* runtime-injected env (`window.__ENV__.NEXT_PUBLIC_AUTH_URL`) is
|
|
147744
|
-
* `formId` the link resolves the platform's default form (404
|
|
147745
|
-
* `
|
|
147746
|
-
*
|
|
147747
|
-
|
|
147748
|
-
|
|
148073
|
+
* (`<auth-url>/applications/<platform-key>/<form-id>?redirect-to=<origin>`), or
|
|
148074
|
+
* null when the auth SPA URL cannot be resolved. `authSpaUrl` (prop) wins;
|
|
148075
|
+
* otherwise the runtime-injected env (`window.__ENV__.NEXT_PUBLIC_AUTH_URL`) is
|
|
148076
|
+
* used. With no `formId` the link resolves the platform's default form (404
|
|
148077
|
+
* when none). The `redirect-to` param carries the origin the applicant is sent
|
|
148078
|
+
* back to after submitting — by default the origin the link is copied from — and
|
|
148079
|
+
* is omitted when no origin can be read (no DOM).
|
|
148080
|
+
*/
|
|
148081
|
+
function buildApplicationLink(platformKey, formId, authSpaUrl, redirectTo) {
|
|
147749
148082
|
var _a, _b;
|
|
147750
148083
|
const base = (_b = authSpaUrl !== null && authSpaUrl !== void 0 ? authSpaUrl : (typeof window !== 'undefined'
|
|
147751
148084
|
? (_a = window.__ENV__) === null || _a === void 0 ? void 0 : _a.NEXT_PUBLIC_AUTH_URL
|
|
@@ -147754,7 +148087,8 @@ function buildApplicationLink(platformKey, formId, authSpaUrl, app) {
|
|
|
147754
148087
|
return null;
|
|
147755
148088
|
const root = `${trimTrailingSlashes(base)}/applications/${encodeURIComponent(platformKey)}`;
|
|
147756
148089
|
const path = formId != null ? `${root}/${encodeURIComponent(String(formId))}` : root;
|
|
147757
|
-
|
|
148090
|
+
const target = (typeof window !== 'undefined' ? window.location.origin : undefined);
|
|
148091
|
+
return target ? `${path}?redirect-to=${encodeURIComponent(target)}` : path;
|
|
147758
148092
|
}
|
|
147759
148093
|
/**
|
|
147760
148094
|
* Applications management. Entry view lists the platform's application forms
|
|
@@ -147762,7 +148096,7 @@ function buildApplicationLink(platformKey, formId, authSpaUrl, app) {
|
|
|
147762
148096
|
* per-form (or all-form) submission pipelines, the submission workspace with
|
|
147763
148097
|
* per-student decisions, the form/question editor, and the ban list.
|
|
147764
148098
|
*/
|
|
147765
|
-
function ApplicationsTab({ platformKey, authSpaUrl,
|
|
148099
|
+
function ApplicationsTab({ platformKey, authSpaUrl, }) {
|
|
147766
148100
|
const [view, setView] = useState({ name: 'forms' });
|
|
147767
148101
|
if (view.name === 'editor') {
|
|
147768
148102
|
return (jsx(QuestionsEditor, { platformKey: platformKey, initialFormId: view.formId, startNew: view.startNew, onBack: () => setView({ name: 'forms' }) }));
|
|
@@ -147776,10 +148110,10 @@ function ApplicationsTab({ platformKey, authSpaUrl, currentSpa, }) {
|
|
|
147776
148110
|
if (view.name === 'submissions') {
|
|
147777
148111
|
return (jsx(SubmissionsPipeline, { platformKey: platformKey, form: view.form, onBack: () => setView({ name: 'forms' }), onOpen: (submissionId) => setView({ name: 'detail', submissionId, form: view.form }) }));
|
|
147778
148112
|
}
|
|
147779
|
-
return (jsx(FormsList, { platformKey: platformKey, authSpaUrl: authSpaUrl,
|
|
148113
|
+
return (jsx(FormsList, { platformKey: platformKey, authSpaUrl: authSpaUrl, onViewSubmissions: (form) => setView({ name: 'submissions', form }), onEditForm: (formId) => setView({ name: 'editor', formId, startNew: false }), onNewForm: () => setView({ name: 'editor', formId: null, startNew: true }), onViewBlocks: () => setView({ name: 'blocks' }) }));
|
|
147780
148114
|
}
|
|
147781
148115
|
/** The entry view: every application form of the platform, with actions. */
|
|
147782
|
-
function FormsList({ platformKey, authSpaUrl,
|
|
148116
|
+
function FormsList({ platformKey, authSpaUrl, onViewSubmissions, onEditForm, onNewForm, onViewBlocks, }) {
|
|
147783
148117
|
const t = useT();
|
|
147784
148118
|
/** The form id whose link was just copied (transient "Copied" feedback). */
|
|
147785
148119
|
const [copiedFormId, setCopiedFormId] = useState(null);
|
|
@@ -147793,7 +148127,7 @@ function FormsList({ platformKey, authSpaUrl, currentSpa, onViewSubmissions, onE
|
|
|
147793
148127
|
const counts = statsCounts(stats);
|
|
147794
148128
|
const total = Object.values(counts).reduce((sum, n) => sum + n, 0);
|
|
147795
148129
|
const handleCopyLink = async (form) => {
|
|
147796
|
-
const link = buildApplicationLink(platformKey, form.id, authSpaUrl
|
|
148130
|
+
const link = buildApplicationLink(platformKey, form.id, authSpaUrl);
|
|
147797
148131
|
if (!link)
|
|
147798
148132
|
return;
|
|
147799
148133
|
try {
|
|
@@ -147813,7 +148147,7 @@ function FormsList({ platformKey, authSpaUrl, currentSpa, onViewSubmissions, onE
|
|
|
147813
148147
|
? 'bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-900'
|
|
147814
148148
|
: 'bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-600', children: t(form.enabled
|
|
147815
148149
|
? 'profileApplicationsTab.formEnabled'
|
|
147816
|
-
: 'profileApplicationsTab.formDisabled') }) }), jsx("td", { className: "whitespace-nowrap px-6 py-4 text-right", children: jsxs("div", { className: "flex items-center justify-end gap-1", children: [buildApplicationLink(platformKey, form.id, authSpaUrl
|
|
148150
|
+
: 'profileApplicationsTab.formDisabled') }) }), jsx("td", { className: "whitespace-nowrap px-6 py-4 text-right", children: jsxs("div", { className: "flex items-center justify-end gap-1", children: [buildApplicationLink(platformKey, form.id, authSpaUrl) && (jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", className: copiedFormId === form.id
|
|
147817
148151
|
? 'h-8 w-8 p-0 text-blue-600 dark:text-blue-400'
|
|
147818
148152
|
: 'h-8 w-8 p-0 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100', onClick: () => handleCopyLink(form), "aria-label": t('profileApplicationsTab.copyFormLink', {
|
|
147819
148153
|
form: ((_b = form.schema) === null || _b === void 0 ? void 0 : _b.title) ||
|
|
@@ -147924,7 +148258,7 @@ const TabDescription = ({ icon, title, children }) => {
|
|
|
147924
148258
|
};
|
|
147925
148259
|
const Admin = ({ tenant, onInviteClick, hasUserTabPermission = false, hasGroupsTabPermission = false, hasRolesTabPermission = false, hasPoliciesTabPermission = false, hasTeamsTabPermission = false, hasAlertsTabPermission = false, hasInviteUserPermission = false, hasCreateTeamPermission = false, onLoadGroupPermissions, rbacPermissions = {}, enableRbac = false, showGradebookTab = false, currentSpa, authSpaUrl, }) => {
|
|
147926
148260
|
const t = useT();
|
|
147927
|
-
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": t('profileAdmin.rbacManagementTabsAriaLabel'), children: [jsxs(TabsList, { "aria-label": t('profileAdmin.managementTabsAriaLabel'), className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && (jsx(TabsTrigger, { value: "users", children: t('profileAdmin.usersTab') })), hasGroupsTabPermission && (jsx(TabsTrigger, { value: "groups", children: t('profileAdmin.groupsTab') })), hasRolesTabPermission && (jsx(TabsTrigger, { value: "roles", children: t('profileAdmin.rolesTab') })), hasPoliciesTabPermission && (jsx(TabsTrigger, { value: "policies", children: t('profileAdmin.policiesTab') })), hasTeamsTabPermission && (jsx(TabsTrigger, { value: "teams", children: t('profileAdmin.teamsTab') })), hasAlertsTabPermission && (jsx(TabsTrigger, { value: "alerts", children: t('profileAdmin.alertsTab') })), jsx(TabsTrigger, { value: "applications", children: t('profileAdmin.applicationsTab') })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: t('profileAdmin.usersTab'), children: t('profileAdmin.usersDescription') }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick, currentSpa: currentSpa, showGradebookTab: showGradebookTab })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: t('profileAdmin.groupsTab'), children: t('profileAdmin.groupsDescription') }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: t('profileAdmin.rolesTab'), children: t('profileAdmin.rolesDescription') }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsx(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: t('profileAdmin.policiesTab'), children: t('profileAdmin.policiesDescription') }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: t('profileAdmin.teamsTab'), children: t('profileAdmin.teamsDescription') }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: t('profileAdmin.alertsTab'), children: t('profileAdmin.alertsDescription') }), jsx(AlertsTab$1, { tenant: tenant })] })), jsxs(TabsContent, { className: "mt-4", value: "applications", children: [jsx(TabDescription, { icon: jsx(ClipboardList, { className: "w-5 h-5" }), title: t('profileAdmin.applicationsTab'), children: t('profileAdmin.applicationsTabDescription') }), jsx(ApplicationsTab, { platformKey: tenant, authSpaUrl: authSpaUrl
|
|
148261
|
+
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": t('profileAdmin.rbacManagementTabsAriaLabel'), children: [jsxs(TabsList, { "aria-label": t('profileAdmin.managementTabsAriaLabel'), className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && (jsx(TabsTrigger, { value: "users", children: t('profileAdmin.usersTab') })), hasGroupsTabPermission && (jsx(TabsTrigger, { value: "groups", children: t('profileAdmin.groupsTab') })), hasRolesTabPermission && (jsx(TabsTrigger, { value: "roles", children: t('profileAdmin.rolesTab') })), hasPoliciesTabPermission && (jsx(TabsTrigger, { value: "policies", children: t('profileAdmin.policiesTab') })), hasTeamsTabPermission && (jsx(TabsTrigger, { value: "teams", children: t('profileAdmin.teamsTab') })), hasAlertsTabPermission && (jsx(TabsTrigger, { value: "alerts", children: t('profileAdmin.alertsTab') })), jsx(TabsTrigger, { value: "applications", children: t('profileAdmin.applicationsTab') })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: t('profileAdmin.usersTab'), children: t('profileAdmin.usersDescription') }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick, currentSpa: currentSpa, showGradebookTab: showGradebookTab })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: t('profileAdmin.groupsTab'), children: t('profileAdmin.groupsDescription') }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: t('profileAdmin.rolesTab'), children: t('profileAdmin.rolesDescription') }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsx(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: t('profileAdmin.policiesTab'), children: t('profileAdmin.policiesDescription') }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: t('profileAdmin.teamsTab'), children: t('profileAdmin.teamsDescription') }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: t('profileAdmin.alertsTab'), children: t('profileAdmin.alertsDescription') }), jsx(AlertsTab$1, { tenant: tenant })] })), jsxs(TabsContent, { className: "mt-4", value: "applications", children: [jsx(TabDescription, { icon: jsx(ClipboardList, { className: "w-5 h-5" }), title: t('profileAdmin.applicationsTab'), children: t('profileAdmin.applicationsTabDescription') }), jsx(ApplicationsTab, { platformKey: tenant, authSpaUrl: authSpaUrl })] })] }) }));
|
|
147928
148262
|
};
|
|
147929
148263
|
|
|
147930
148264
|
function DeleteApiModal({ isOpen, onClose, apiKey, tenantKey }) {
|
|
@@ -173070,7 +173404,7 @@ function inputRulesPlugin(props) {
|
|
|
173070
173404
|
function getType(value) {
|
|
173071
173405
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
173072
173406
|
}
|
|
173073
|
-
function isPlainObject(value) {
|
|
173407
|
+
function isPlainObject$1(value) {
|
|
173074
173408
|
if (getType(value) !== "Object") {
|
|
173075
173409
|
return false;
|
|
173076
173410
|
}
|
|
@@ -173080,9 +173414,9 @@ function isPlainObject(value) {
|
|
|
173080
173414
|
// src/utilities/mergeDeep.ts
|
|
173081
173415
|
function mergeDeep(target, source) {
|
|
173082
173416
|
const output = { ...target };
|
|
173083
|
-
if (isPlainObject(target) && isPlainObject(source)) {
|
|
173417
|
+
if (isPlainObject$1(target) && isPlainObject$1(source)) {
|
|
173084
173418
|
Object.keys(source).forEach((key) => {
|
|
173085
|
-
if (isPlainObject(source[key]) && isPlainObject(target[key])) {
|
|
173419
|
+
if (isPlainObject$1(source[key]) && isPlainObject$1(target[key])) {
|
|
173086
173420
|
output[key] = mergeDeep(target[key], source[key]);
|
|
173087
173421
|
} else {
|
|
173088
173422
|
output[key] = source[key];
|
|
@@ -185980,7 +186314,7 @@ const toTimeString = (value) => {
|
|
|
185980
186314
|
return date.toISOString().slice(11, 16);
|
|
185981
186315
|
};
|
|
185982
186316
|
const DEFAULT_TIMEZONE = 'UTC';
|
|
185983
|
-
const isValidTimeZone = (value) => {
|
|
186317
|
+
const isValidTimeZone$1 = (value) => {
|
|
185984
186318
|
if (!value) {
|
|
185985
186319
|
return false;
|
|
185986
186320
|
}
|
|
@@ -185994,12 +186328,12 @@ const isValidTimeZone = (value) => {
|
|
|
185994
186328
|
};
|
|
185995
186329
|
const resolveTimezone = (...candidates) => {
|
|
185996
186330
|
for (const candidate of candidates) {
|
|
185997
|
-
if (isValidTimeZone(candidate)) {
|
|
186331
|
+
if (isValidTimeZone$1(candidate)) {
|
|
185998
186332
|
return candidate;
|
|
185999
186333
|
}
|
|
186000
186334
|
}
|
|
186001
186335
|
const localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
186002
|
-
if (isValidTimeZone(localTimeZone)) {
|
|
186336
|
+
if (isValidTimeZone$1(localTimeZone)) {
|
|
186003
186337
|
return localTimeZone;
|
|
186004
186338
|
}
|
|
186005
186339
|
return DEFAULT_TIMEZONE;
|
|
@@ -187364,7 +187698,7 @@ const ChartLoading = ({ title = 'Loading...' }) => {
|
|
|
187364
187698
|
};
|
|
187365
187699
|
|
|
187366
187700
|
// Utility function to format date to YYYY-MM-DD
|
|
187367
|
-
const formatDateToYYYYMMDD$
|
|
187701
|
+
const formatDateToYYYYMMDD$7 = (date) => {
|
|
187368
187702
|
if (!date)
|
|
187369
187703
|
return undefined;
|
|
187370
187704
|
return date.toISOString().split('T')[0];
|
|
@@ -187414,8 +187748,8 @@ const useOverview = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187414
187748
|
metric: 'active_users',
|
|
187415
187749
|
platform_key: tenantKey,
|
|
187416
187750
|
...(usersStatsDateFilter.activeFilter === 'custom' && {
|
|
187417
|
-
start_date: formatDateToYYYYMMDD$
|
|
187418
|
-
end_date: formatDateToYYYYMMDD$
|
|
187751
|
+
start_date: formatDateToYYYYMMDD$7((_g = usersStatsDateFilter.dateRange) === null || _g === void 0 ? void 0 : _g.startDate),
|
|
187752
|
+
end_date: formatDateToYYYYMMDD$7((_h = usersStatsDateFilter.dateRange) === null || _h === void 0 ? void 0 : _h.endDate),
|
|
187419
187753
|
}),
|
|
187420
187754
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187421
187755
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -187424,8 +187758,8 @@ const useOverview = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187424
187758
|
date_filter: sessionStatsDateFilter.activeFilter || FILTER_30D,
|
|
187425
187759
|
platform_key: tenantKey,
|
|
187426
187760
|
...(sessionStatsDateFilter.activeFilter === 'custom' && {
|
|
187427
|
-
start_date: formatDateToYYYYMMDD$
|
|
187428
|
-
end_date: formatDateToYYYYMMDD$
|
|
187761
|
+
start_date: formatDateToYYYYMMDD$7((_j = sessionStatsDateFilter.dateRange) === null || _j === void 0 ? void 0 : _j.startDate),
|
|
187762
|
+
end_date: formatDateToYYYYMMDD$7((_k = sessionStatsDateFilter.dateRange) === null || _k === void 0 ? void 0 : _k.endDate),
|
|
187429
187763
|
}),
|
|
187430
187764
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187431
187765
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -187434,8 +187768,8 @@ const useOverview = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187434
187768
|
date_filter: topicsDetailsStatsDateFilter.activeFilter || FILTER_30D,
|
|
187435
187769
|
platform_key: tenantKey,
|
|
187436
187770
|
...(topicsDetailsStatsDateFilter.activeFilter === 'custom' && {
|
|
187437
|
-
start_date: formatDateToYYYYMMDD$
|
|
187438
|
-
end_date: formatDateToYYYYMMDD$
|
|
187771
|
+
start_date: formatDateToYYYYMMDD$7((_l = topicsDetailsStatsDateFilter.dateRange) === null || _l === void 0 ? void 0 : _l.startDate),
|
|
187772
|
+
end_date: formatDateToYYYYMMDD$7((_m = topicsDetailsStatsDateFilter.dateRange) === null || _m === void 0 ? void 0 : _m.endDate),
|
|
187439
187773
|
}),
|
|
187440
187774
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187441
187775
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -187625,12 +187959,12 @@ function AnalyticsLayout({ children, currentPath, basePath, onTabChange, tabs =
|
|
|
187625
187959
|
return;
|
|
187626
187960
|
onTabChange(tabValue);
|
|
187627
187961
|
};
|
|
187628
|
-
return (jsxs("div", { className: "flex flex-col flex-1 min-h-0 h-full overflow-hidden overscroll-none bg-[#f5f7fb]", children: [jsx("div", { className: "p-6 pb-0", children: jsx("div", { className: "flex items-center justify-between mb-
|
|
187962
|
+
return (jsxs("div", { className: "flex flex-col flex-1 min-h-0 h-full overflow-hidden overscroll-none bg-[#f5f7fb]", children: [jsx("div", { className: "p-6 pb-0 pt-4 xs:pt-0", children: jsx("div", { className: "flex items-center justify-between mb-4 xs:mb-2", children: jsxs("div", { className: "flex items-center justify-between w-full overflow-x-auto", children: [jsx(Tabs, { className: "bg-[#f5f7fb]", value: activeTab, children: jsx(TabsList, { className: "bg-[#f5f7fb]", children: tabs
|
|
187629
187963
|
.filter((tab) => !excludeTabs.includes(tab.value) && canAccessTab(tab.value))
|
|
187630
187964
|
.map((tab) => {
|
|
187631
187965
|
const isActive = activeTab === tab.value;
|
|
187632
187966
|
return (jsx(TabsTrigger, { value: tab.value, className: cn(className, isActive && activeTabClassName), onClick: () => handleTabClick(tab.value), children: tab.label }, tab.value));
|
|
187633
|
-
}) }) }), jsxs("div", { className: "flex items-center gap-4", children: [beforeDataReports, canAccessTab('reports') && (jsx(Tabs, { className: "
|
|
187967
|
+
}) }) }), jsxs("div", { className: "flex items-center gap-4", children: [beforeDataReports, canAccessTab('reports') && (jsx(Tabs, { className: "bg-[#f5f7fb]", value: activeTab, children: jsx(TabsList, { className: "bg-[#f5f7fb]", children: jsx(TabsTrigger, { value: "reports", className: cn(className, activeTab === 'reports' && activeTabClassName), onClick: () => handleTabClick('reports'), children: "Data Reports" }) }) }))] })] }) }) }), jsx("div", { className: "flex-1 overflow-auto overscroll-contain scrollbar-none px-6 pb-6 pt-0", children: isActiveTabAllowed ? children : null })] }));
|
|
187634
187968
|
}
|
|
187635
187969
|
|
|
187636
187970
|
const accessTimeData = [
|
|
@@ -187698,7 +188032,7 @@ function AccessTimeHeatmap({ accessTimeData, loading, }) {
|
|
|
187698
188032
|
}
|
|
187699
188033
|
|
|
187700
188034
|
// Utility function to format date to YYYY-MM-DD
|
|
187701
|
-
const formatDateToYYYYMMDD$
|
|
188035
|
+
const formatDateToYYYYMMDD$6 = (date) => {
|
|
187702
188036
|
if (!date)
|
|
187703
188037
|
return undefined;
|
|
187704
188038
|
return date.toISOString().split('T')[0];
|
|
@@ -187738,8 +188072,8 @@ const useUsers = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187738
188072
|
metric: 'active_users',
|
|
187739
188073
|
platform_key: tenantKey,
|
|
187740
188074
|
...(activeUsersStatsDateFilter.activeFilter === 'custom' && {
|
|
187741
|
-
start_date: formatDateToYYYYMMDD$
|
|
187742
|
-
end_date: formatDateToYYYYMMDD$
|
|
188075
|
+
start_date: formatDateToYYYYMMDD$6((_a = activeUsersStatsDateFilter.dateRange) === null || _a === void 0 ? void 0 : _a.startDate),
|
|
188076
|
+
end_date: formatDateToYYYYMMDD$6((_b = activeUsersStatsDateFilter.dateRange) === null || _b === void 0 ? void 0 : _b.endDate),
|
|
187743
188077
|
}),
|
|
187744
188078
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187745
188079
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -187748,8 +188082,8 @@ const useUsers = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187748
188082
|
date_filter: accessTimeHeatmapDateFilter.activeFilter || FILTER_30D,
|
|
187749
188083
|
platform_key: tenantKey,
|
|
187750
188084
|
...(accessTimeHeatmapDateFilter.activeFilter === 'custom' && {
|
|
187751
|
-
start_date: formatDateToYYYYMMDD$
|
|
187752
|
-
end_date: formatDateToYYYYMMDD$
|
|
188085
|
+
start_date: formatDateToYYYYMMDD$6((_c = accessTimeHeatmapDateFilter.dateRange) === null || _c === void 0 ? void 0 : _c.startDate),
|
|
188086
|
+
end_date: formatDateToYYYYMMDD$6((_d = accessTimeHeatmapDateFilter.dateRange) === null || _d === void 0 ? void 0 : _d.endDate),
|
|
187753
188087
|
}),
|
|
187754
188088
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187755
188089
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -187758,8 +188092,8 @@ const useUsers = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187758
188092
|
date_filter: userDetailsStatsDateFilter.activeFilter || FILTER_30D,
|
|
187759
188093
|
platform_key: tenantKey,
|
|
187760
188094
|
...(userDetailsStatsDateFilter.activeFilter === 'custom' && {
|
|
187761
|
-
start_date: formatDateToYYYYMMDD$
|
|
187762
|
-
end_date: formatDateToYYYYMMDD$
|
|
188095
|
+
start_date: formatDateToYYYYMMDD$6((_e = userDetailsStatsDateFilter.dateRange) === null || _e === void 0 ? void 0 : _e.startDate),
|
|
188096
|
+
end_date: formatDateToYYYYMMDD$6((_f = userDetailsStatsDateFilter.dateRange) === null || _f === void 0 ? void 0 : _f.endDate),
|
|
187763
188097
|
}),
|
|
187764
188098
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187765
188099
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -187882,7 +188216,7 @@ function AnalyticsUsersStats({ tenantKey, mentorId, selectedMentorId, usergroupI
|
|
|
187882
188216
|
}
|
|
187883
188217
|
|
|
187884
188218
|
// Utility function to format date to YYYY-MM-DD
|
|
187885
|
-
const formatDateToYYYYMMDD$
|
|
188219
|
+
const formatDateToYYYYMMDD$5 = (date) => {
|
|
187886
188220
|
if (!date)
|
|
187887
188221
|
return undefined;
|
|
187888
188222
|
return date.toISOString().split('T')[0];
|
|
@@ -187900,8 +188234,8 @@ const useTopics = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187900
188234
|
metric: 'conversations',
|
|
187901
188235
|
date_filter: conversationsStatsDateFilter.activeFilter || FILTER_30D,
|
|
187902
188236
|
...(conversationsStatsDateFilter.activeFilter === 'custom' && {
|
|
187903
|
-
start_date: formatDateToYYYYMMDD$
|
|
187904
|
-
end_date: formatDateToYYYYMMDD$
|
|
188237
|
+
start_date: formatDateToYYYYMMDD$5((_a = conversationsStatsDateFilter.dateRange) === null || _a === void 0 ? void 0 : _a.startDate),
|
|
188238
|
+
end_date: formatDateToYYYYMMDD$5((_b = conversationsStatsDateFilter.dateRange) === null || _b === void 0 ? void 0 : _b.endDate),
|
|
187905
188239
|
}),
|
|
187906
188240
|
});
|
|
187907
188241
|
const { data: topicsStats, isLoading: isLoadingTopicsStats } = useGetTopicsStatsQuery({
|
|
@@ -187919,8 +188253,8 @@ const useTopics = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187919
188253
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187920
188254
|
date_filter: averageRatingDateFilter.activeFilter || FILTER_30D,
|
|
187921
188255
|
...(averageRatingDateFilter.activeFilter === 'custom' && {
|
|
187922
|
-
start_date: formatDateToYYYYMMDD$
|
|
187923
|
-
end_date: formatDateToYYYYMMDD$
|
|
188256
|
+
start_date: formatDateToYYYYMMDD$5((_c = averageRatingDateFilter.dateRange) === null || _c === void 0 ? void 0 : _c.startDate),
|
|
188257
|
+
end_date: formatDateToYYYYMMDD$5((_d = averageRatingDateFilter.dateRange) === null || _d === void 0 ? void 0 : _d.endDate),
|
|
187924
188258
|
}),
|
|
187925
188259
|
});
|
|
187926
188260
|
const [topicsDetailsDateFilter, setTopicsDetailsDateFilter] = useState({
|
|
@@ -187931,8 +188265,8 @@ const useTopics = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
187931
188265
|
date_filter: topicsDetailsDateFilter.activeFilter || FILTER_30D,
|
|
187932
188266
|
platform_key: tenantKey,
|
|
187933
188267
|
...(topicsDetailsDateFilter.activeFilter === 'custom' && {
|
|
187934
|
-
start_date: formatDateToYYYYMMDD$
|
|
187935
|
-
end_date: formatDateToYYYYMMDD$
|
|
188268
|
+
start_date: formatDateToYYYYMMDD$5((_e = topicsDetailsDateFilter.dateRange) === null || _e === void 0 ? void 0 : _e.startDate),
|
|
188269
|
+
end_date: formatDateToYYYYMMDD$5((_f = topicsDetailsDateFilter.dateRange) === null || _f === void 0 ? void 0 : _f.endDate),
|
|
187936
188270
|
}),
|
|
187937
188271
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
187938
188272
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -188006,7 +188340,7 @@ function AnalyticsTopicsStats({ tenantKey, mentorId, selectedMentorId, usergroup
|
|
|
188006
188340
|
}
|
|
188007
188341
|
|
|
188008
188342
|
// Utility function to format date to YYYY-MM-DD
|
|
188009
|
-
const formatDateToYYYYMMDD$
|
|
188343
|
+
const formatDateToYYYYMMDD$4 = (date) => {
|
|
188010
188344
|
if (!date)
|
|
188011
188345
|
return undefined;
|
|
188012
188346
|
return date.toISOString().split('T')[0];
|
|
@@ -188064,8 +188398,8 @@ const useFinancial = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
188064
188398
|
date_filter: detailedCostPerDayFilters.activeFilter || FILTER_30D,
|
|
188065
188399
|
platform_key: tenantKey,
|
|
188066
188400
|
...(detailedCostPerDayFilters.activeFilter === 'custom' && {
|
|
188067
|
-
start_date: formatDateToYYYYMMDD$
|
|
188068
|
-
end_date: formatDateToYYYYMMDD$
|
|
188401
|
+
start_date: formatDateToYYYYMMDD$4((_a = detailedCostPerDayFilters.dateRange) === null || _a === void 0 ? void 0 : _a.startDate),
|
|
188402
|
+
end_date: formatDateToYYYYMMDD$4((_b = detailedCostPerDayFilters.dateRange) === null || _b === void 0 ? void 0 : _b.endDate),
|
|
188069
188403
|
}),
|
|
188070
188404
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
188071
188405
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -188075,8 +188409,8 @@ const useFinancial = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
188075
188409
|
date_filter: detailedCostPerProviderFilters.activeFilter || FILTER_30D,
|
|
188076
188410
|
platform_key: tenantKey,
|
|
188077
188411
|
...(detailedCostPerProviderFilters.activeFilter === 'custom' && {
|
|
188078
|
-
start_date: formatDateToYYYYMMDD$
|
|
188079
|
-
end_date: formatDateToYYYYMMDD$
|
|
188412
|
+
start_date: formatDateToYYYYMMDD$4((_c = detailedCostPerProviderFilters.dateRange) === null || _c === void 0 ? void 0 : _c.startDate),
|
|
188413
|
+
end_date: formatDateToYYYYMMDD$4((_d = detailedCostPerProviderFilters.dateRange) === null || _d === void 0 ? void 0 : _d.endDate),
|
|
188080
188414
|
}),
|
|
188081
188415
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
188082
188416
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -188087,8 +188421,8 @@ const useFinancial = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
188087
188421
|
date_filter: detailedCostPerUserFilters.activeFilter || FILTER_30D,
|
|
188088
188422
|
platform_key: tenantKey,
|
|
188089
188423
|
...(detailedCostPerUserFilters.activeFilter === 'custom' && {
|
|
188090
|
-
start_date: formatDateToYYYYMMDD$
|
|
188091
|
-
end_date: formatDateToYYYYMMDD$
|
|
188424
|
+
start_date: formatDateToYYYYMMDD$4((_e = detailedCostPerUserFilters.dateRange) === null || _e === void 0 ? void 0 : _e.startDate),
|
|
188425
|
+
end_date: formatDateToYYYYMMDD$4((_f = detailedCostPerUserFilters.dateRange) === null || _f === void 0 ? void 0 : _f.endDate),
|
|
188092
188426
|
}),
|
|
188093
188427
|
page: costPerUserPage,
|
|
188094
188428
|
limit: costPerUserLimit,
|
|
@@ -188102,8 +188436,8 @@ const useFinancial = ({ tenantKey, mentorId, usergroupIds, }) => {
|
|
|
188102
188436
|
date_filter: detailedLLMCostFilters.activeFilter || FILTER_30D,
|
|
188103
188437
|
platform_key: tenantKey,
|
|
188104
188438
|
...(detailedLLMCostFilters.activeFilter === 'custom' && {
|
|
188105
|
-
start_date: formatDateToYYYYMMDD$
|
|
188106
|
-
end_date: formatDateToYYYYMMDD$
|
|
188439
|
+
start_date: formatDateToYYYYMMDD$4((_g = detailedLLMCostFilters.dateRange) === null || _g === void 0 ? void 0 : _g.startDate),
|
|
188440
|
+
end_date: formatDateToYYYYMMDD$4((_h = detailedLLMCostFilters.dateRange) === null || _h === void 0 ? void 0 : _h.endDate),
|
|
188107
188441
|
}),
|
|
188108
188442
|
...(mentorId ? { mentor_unique_id: mentorId } : {}),
|
|
188109
188443
|
...((usergroupIds === null || usergroupIds === void 0 ? void 0 : usergroupIds.length) ? { usergroup_ids: usergroupIds } : {}),
|
|
@@ -223986,7 +224320,7 @@ function ReportRangeDayButton({ day, modifiers, className, ...props }) {
|
|
|
223986
224320
|
}
|
|
223987
224321
|
|
|
223988
224322
|
// Utility function to format date to YYYY-MM-DD
|
|
223989
|
-
const formatDateToYYYYMMDD$
|
|
224323
|
+
const formatDateToYYYYMMDD$3 = (date) => {
|
|
223990
224324
|
if (!date)
|
|
223991
224325
|
return undefined;
|
|
223992
224326
|
return date.toISOString().split('T')[0];
|
|
@@ -224047,8 +224381,8 @@ const useCourses = ({ tenantKey, mentorId, courseId, }) => {
|
|
|
224047
224381
|
return ({
|
|
224048
224382
|
metric: 'course',
|
|
224049
224383
|
date_filter: enrollmentStatsDateFilter.activeFilter,
|
|
224050
|
-
start_date: formatDateToYYYYMMDD$
|
|
224051
|
-
end_date: formatDateToYYYYMMDD$
|
|
224384
|
+
start_date: formatDateToYYYYMMDD$3((_a = enrollmentStatsDateFilter.dateRange) === null || _a === void 0 ? void 0 : _a.startDate),
|
|
224385
|
+
end_date: formatDateToYYYYMMDD$3((_b = enrollmentStatsDateFilter.dateRange) === null || _b === void 0 ? void 0 : _b.endDate),
|
|
224052
224386
|
include_overtime: true,
|
|
224053
224387
|
platform_key: tenantKey,
|
|
224054
224388
|
mentor_unique_id: mentorId,
|
|
@@ -224072,8 +224406,8 @@ const useCourses = ({ tenantKey, mentorId, courseId, }) => {
|
|
|
224072
224406
|
content_id: courseId,
|
|
224073
224407
|
metric: 'course',
|
|
224074
224408
|
date_filter: timeSpentStatsDateFilter.activeFilter,
|
|
224075
|
-
start_date: formatDateToYYYYMMDD$
|
|
224076
|
-
end_date: formatDateToYYYYMMDD$
|
|
224409
|
+
start_date: formatDateToYYYYMMDD$3((_a = timeSpentStatsDateFilter.dateRange) === null || _a === void 0 ? void 0 : _a.startDate),
|
|
224410
|
+
end_date: formatDateToYYYYMMDD$3((_b = timeSpentStatsDateFilter.dateRange) === null || _b === void 0 ? void 0 : _b.endDate),
|
|
224077
224411
|
include_overtime: true,
|
|
224078
224412
|
platform_key: tenantKey,
|
|
224079
224413
|
mentor_unique_id: mentorId,
|
|
@@ -224343,7 +224677,7 @@ function AnalyticsCourseDetail({ tenantKey, mentorId, selectedMentorId, courseId
|
|
|
224343
224677
|
}
|
|
224344
224678
|
|
|
224345
224679
|
// Utility function to format date to YYYY-MM-DD
|
|
224346
|
-
const formatDateToYYYYMMDD$
|
|
224680
|
+
const formatDateToYYYYMMDD$2 = (date) => {
|
|
224347
224681
|
if (!date)
|
|
224348
224682
|
return undefined;
|
|
224349
224683
|
return date.toISOString().split('T')[0];
|
|
@@ -224404,8 +224738,8 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
|
|
|
224404
224738
|
return ({
|
|
224405
224739
|
metric: 'program',
|
|
224406
224740
|
date_filter: enrollmentStatsDateFilter.activeFilter,
|
|
224407
|
-
start_date: formatDateToYYYYMMDD$
|
|
224408
|
-
end_date: formatDateToYYYYMMDD$
|
|
224741
|
+
start_date: formatDateToYYYYMMDD$2((_a = enrollmentStatsDateFilter.dateRange) === null || _a === void 0 ? void 0 : _a.startDate),
|
|
224742
|
+
end_date: formatDateToYYYYMMDD$2((_b = enrollmentStatsDateFilter.dateRange) === null || _b === void 0 ? void 0 : _b.endDate),
|
|
224409
224743
|
include_overtime: true,
|
|
224410
224744
|
platform_key: tenantKey,
|
|
224411
224745
|
mentor_unique_id: mentorId,
|
|
@@ -224429,8 +224763,8 @@ const usePrograms = ({ tenantKey, mentorId, programId, }) => {
|
|
|
224429
224763
|
content_id: programId,
|
|
224430
224764
|
metric: 'program',
|
|
224431
224765
|
date_filter: timeSpentStatsDateFilter.activeFilter,
|
|
224432
|
-
start_date: formatDateToYYYYMMDD$
|
|
224433
|
-
end_date: formatDateToYYYYMMDD$
|
|
224766
|
+
start_date: formatDateToYYYYMMDD$2((_a = timeSpentStatsDateFilter.dateRange) === null || _a === void 0 ? void 0 : _a.startDate),
|
|
224767
|
+
end_date: formatDateToYYYYMMDD$2((_b = timeSpentStatsDateFilter.dateRange) === null || _b === void 0 ? void 0 : _b.endDate),
|
|
224434
224768
|
include_overtime: true,
|
|
224435
224769
|
platform_key: tenantKey,
|
|
224436
224770
|
mentor_unique_id: mentorId,
|
|
@@ -224917,7 +225251,7 @@ function AnalyticsMonetizationStats({ tenantKey }) {
|
|
|
224917
225251
|
setPaywallPage(paywallsData.previous_page), children: t('analyticsAnalyticsMonetizationStats.previous') }), jsx("span", { className: "text-xs text-gray-500", children: t('analyticsAnalyticsMonetizationStats.pageLabel', { page: paywallPage }) }), jsx(Button$1, { variant: "outline", size: "sm", className: "h-8 text-xs", disabled: paywallsData.next_page === null, onClick: () => paywallsData.next_page !== null && setPaywallPage(paywallsData.next_page), children: t('analyticsAnalyticsMonetizationStats.next') })] })] }))] }) })] }));
|
|
224918
225252
|
}
|
|
224919
225253
|
|
|
224920
|
-
const formatDateToYYYYMMDD = (date) => {
|
|
225254
|
+
const formatDateToYYYYMMDD$1 = (date) => {
|
|
224921
225255
|
if (!date)
|
|
224922
225256
|
return undefined;
|
|
224923
225257
|
return date.toISOString().split('T')[0];
|
|
@@ -224947,8 +225281,8 @@ const useAuditLog = ({ tenantKey, userId, mentorId, }) => {
|
|
|
224947
225281
|
...(mentorId ? { mentor: mentorId } : {}),
|
|
224948
225282
|
...(actionFilter !== undefined ? { action: actionFilter } : {}),
|
|
224949
225283
|
...(actorFilter ? { actor_email: actorFilter } : {}),
|
|
224950
|
-
...((dateRange === null || dateRange === void 0 ? void 0 : dateRange.from) ? { from_date: formatDateToYYYYMMDD(dateRange.from) } : {}),
|
|
224951
|
-
...((dateRange === null || dateRange === void 0 ? void 0 : dateRange.to) ? { to_date: formatDateToYYYYMMDD(dateRange.to) } : {}),
|
|
225284
|
+
...((dateRange === null || dateRange === void 0 ? void 0 : dateRange.from) ? { from_date: formatDateToYYYYMMDD$1(dateRange.from) } : {}),
|
|
225285
|
+
...((dateRange === null || dateRange === void 0 ? void 0 : dateRange.to) ? { to_date: formatDateToYYYYMMDD$1(dateRange.to) } : {}),
|
|
224952
225286
|
};
|
|
224953
225287
|
const { data, isLoading, error, isFetching } = useGetAuditLogsQuery({
|
|
224954
225288
|
org: tenantKey,
|
|
@@ -224984,6 +225318,467 @@ const useAuditLog = ({ tenantKey, userId, mentorId, }) => {
|
|
|
224984
225318
|
};
|
|
224985
225319
|
};
|
|
224986
225320
|
|
|
225321
|
+
function Sheet({ ...props }) {
|
|
225322
|
+
return jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
225323
|
+
}
|
|
225324
|
+
function SheetPortal({ ...props }) {
|
|
225325
|
+
return jsx(DialogPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
225326
|
+
}
|
|
225327
|
+
function SheetOverlay({ className, ...props }) {
|
|
225328
|
+
return (jsx(DialogPrimitive.Overlay, { "data-slot": "sheet-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50', className), ...props }));
|
|
225329
|
+
}
|
|
225330
|
+
function SheetContent({ className, children, side = 'right', ...props }) {
|
|
225331
|
+
const t = useT();
|
|
225332
|
+
return (jsxs(SheetPortal, { children: [jsx(SheetOverlay, {}), jsxs(DialogPrimitive.Content, { "data-slot": "sheet-content", className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500', side === 'right' &&
|
|
225333
|
+
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm', side === 'left' &&
|
|
225334
|
+
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm', side === 'top' &&
|
|
225335
|
+
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b', side === 'bottom' &&
|
|
225336
|
+
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t', className), ...props, children: [children, jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [jsx(X$1, { className: "size-4" }), jsx("span", { className: "sr-only", children: t('uiSheet.close') })] })] })] }));
|
|
225337
|
+
}
|
|
225338
|
+
function SheetHeader({ className, ...props }) {
|
|
225339
|
+
return (jsx("div", { "data-slot": "sheet-header", className: cn('flex flex-col gap-1.5 p-4', className), ...props }));
|
|
225340
|
+
}
|
|
225341
|
+
function SheetTitle({ className, ...props }) {
|
|
225342
|
+
return (jsx(DialogPrimitive.Title, { "data-slot": "sheet-title", className: cn('text-foreground font-semibold', className), ...props }));
|
|
225343
|
+
}
|
|
225344
|
+
function SheetDescription({ className, ...props }) {
|
|
225345
|
+
return (jsx(DialogPrimitive.Description, { "data-slot": "sheet-description", className: cn('text-muted-foreground text-sm', className), ...props }));
|
|
225346
|
+
}
|
|
225347
|
+
|
|
225348
|
+
/**
|
|
225349
|
+
* Generic renderer for the free-form JSON the audit trail carries in
|
|
225350
|
+
* `changes` (CRUD entries) and `metadata` (manual events). Neither field has a
|
|
225351
|
+
* guaranteed shape, so nothing here assumes flat key/value pairs: objects and
|
|
225352
|
+
* arrays nest recursively, unknown keys render as-is, and non-JSON values fall
|
|
225353
|
+
* back to their string form rather than throwing.
|
|
225354
|
+
*/
|
|
225355
|
+
/** Levels expanded on first render; deeper nodes start collapsed. */
|
|
225356
|
+
const AUTO_EXPAND_DEPTH = 2;
|
|
225357
|
+
/**
|
|
225358
|
+
* Hard stop for pathological payloads. JSON can't be cyclic, but a deeply
|
|
225359
|
+
* nested blob would still render thousands of rows and lock the tab.
|
|
225360
|
+
*/
|
|
225361
|
+
const MAX_DEPTH = 20;
|
|
225362
|
+
function isPlainObject(value) {
|
|
225363
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
225364
|
+
}
|
|
225365
|
+
function isBranch(value) {
|
|
225366
|
+
return Array.isArray(value) || isPlainObject(value);
|
|
225367
|
+
}
|
|
225368
|
+
/** Renders a leaf value with a type-appropriate style. */
|
|
225369
|
+
function JsonLeaf({ value }) {
|
|
225370
|
+
const t = useT();
|
|
225371
|
+
if (value === null) {
|
|
225372
|
+
return (jsx("span", { className: "font-mono text-xs text-gray-400", children: t('analyticsAuditLogJsonView.null') }));
|
|
225373
|
+
}
|
|
225374
|
+
if (value === undefined) {
|
|
225375
|
+
return (jsx("span", { className: "font-mono text-xs text-gray-400", children: t('analyticsAuditLogJsonView.empty') }));
|
|
225376
|
+
}
|
|
225377
|
+
if (typeof value === 'boolean') {
|
|
225378
|
+
return jsx("span", { className: "font-mono text-xs text-purple-700", children: String(value) });
|
|
225379
|
+
}
|
|
225380
|
+
if (typeof value === 'number') {
|
|
225381
|
+
return jsx("span", { className: "font-mono text-xs text-blue-700", children: String(value) });
|
|
225382
|
+
}
|
|
225383
|
+
if (typeof value === 'string') {
|
|
225384
|
+
if (value === '') {
|
|
225385
|
+
return (jsx("span", { className: "font-mono text-xs text-gray-400", children: t('analyticsAuditLogJsonView.emptyString') }));
|
|
225386
|
+
}
|
|
225387
|
+
return (jsx("span", { className: "font-mono text-xs break-all whitespace-pre-wrap text-gray-800", children: value }));
|
|
225388
|
+
}
|
|
225389
|
+
// Functions, symbols and bigints can't come out of `JSON.parse`, but the
|
|
225390
|
+
// renderer is public API — degrade instead of crashing.
|
|
225391
|
+
return jsx("span", { className: "font-mono text-xs break-all text-gray-800", children: String(value) });
|
|
225392
|
+
}
|
|
225393
|
+
function JsonBranch({ label, value, depth }) {
|
|
225394
|
+
const t = useT();
|
|
225395
|
+
const [isOpen, setIsOpen] = useState(depth < AUTO_EXPAND_DEPTH);
|
|
225396
|
+
const entries = Array.isArray(value)
|
|
225397
|
+
? value.map((item, index) => [String(index), item])
|
|
225398
|
+
: Object.entries(value);
|
|
225399
|
+
const summary = Array.isArray(value)
|
|
225400
|
+
? t('analyticsAuditLogJsonView.itemCount', { count: entries.length })
|
|
225401
|
+
: t('analyticsAuditLogJsonView.keyCount', { count: entries.length });
|
|
225402
|
+
if (entries.length === 0) {
|
|
225403
|
+
return (jsxs("div", { className: "flex flex-wrap items-baseline gap-2 py-1", children: [jsx("span", { className: "font-mono text-xs font-medium text-gray-600", children: label }), jsx("span", { className: "font-mono text-xs text-gray-400", children: Array.isArray(value)
|
|
225404
|
+
? t('analyticsAuditLogJsonView.emptyList')
|
|
225405
|
+
: t('analyticsAuditLogJsonView.emptyObject') })] }));
|
|
225406
|
+
}
|
|
225407
|
+
return (jsxs("div", { className: "py-0.5", children: [jsxs("button", { type: "button", onClick: () => setIsOpen((open) => !open), "aria-expanded": isOpen, className: "flex items-center gap-1 rounded text-left hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500", children: [isOpen ? (jsx(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-gray-400", "aria-hidden": "true" })) : (jsx(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 text-gray-400", "aria-hidden": "true" })), jsx("span", { className: "font-mono text-xs font-medium text-gray-600", children: label }), jsx("span", { className: "font-mono text-[11px] text-gray-400", children: summary })] }), isOpen && (jsx("div", { className: "ml-2 border-l border-gray-200 pl-3", children: entries.map(([childKey, childValue]) => (jsx(JsonNode, { label: childKey, value: childValue, depth: depth + 1 }, childKey))) }))] }));
|
|
225408
|
+
}
|
|
225409
|
+
function JsonNode({ label, value, depth }) {
|
|
225410
|
+
const t = useT();
|
|
225411
|
+
if (depth >= MAX_DEPTH) {
|
|
225412
|
+
return (jsxs("div", { className: "flex flex-wrap items-baseline gap-2 py-1", children: [jsx("span", { className: "font-mono text-xs font-medium text-gray-600", children: label }), jsx("span", { className: "font-mono text-xs text-gray-400", children: t('analyticsAuditLogJsonView.truncated') })] }));
|
|
225413
|
+
}
|
|
225414
|
+
if (isBranch(value)) {
|
|
225415
|
+
return jsx(JsonBranch, { label: label, value: value, depth: depth });
|
|
225416
|
+
}
|
|
225417
|
+
return (jsxs("div", { className: "flex flex-wrap items-baseline gap-2 py-1", children: [jsx("span", { className: "font-mono text-xs font-medium text-gray-600", children: label }), jsx(JsonLeaf, { value: value })] }));
|
|
225418
|
+
}
|
|
225419
|
+
function AuditLogJsonView({ value, className, emptyLabel }) {
|
|
225420
|
+
const t = useT();
|
|
225421
|
+
const isEmpty = value === null ||
|
|
225422
|
+
value === undefined ||
|
|
225423
|
+
(isPlainObject(value) && Object.keys(value).length === 0) ||
|
|
225424
|
+
(Array.isArray(value) && value.length === 0);
|
|
225425
|
+
if (isEmpty) {
|
|
225426
|
+
return (jsx("p", { className: cn('text-sm text-gray-500', className), children: emptyLabel !== null && emptyLabel !== void 0 ? emptyLabel : t('analyticsAuditLogJsonView.noPayload') }));
|
|
225427
|
+
}
|
|
225428
|
+
// A bare scalar payload still deserves to render rather than be dropped.
|
|
225429
|
+
if (!isBranch(value)) {
|
|
225430
|
+
return (jsx("div", { className: cn('rounded-md border border-gray-200 bg-gray-50 p-3', className), children: jsx(JsonLeaf, { value: value }) }));
|
|
225431
|
+
}
|
|
225432
|
+
const entries = Array.isArray(value)
|
|
225433
|
+
? value.map((item, index) => [String(index), item])
|
|
225434
|
+
: Object.entries(value);
|
|
225435
|
+
return (jsx("div", { className: cn('rounded-md border border-gray-200 bg-gray-50 p-3', className), children: entries.map(([key, childValue]) => (jsx(JsonNode, { label: key, value: childValue, depth: 0 }, key))) }));
|
|
225436
|
+
}
|
|
225437
|
+
/**
|
|
225438
|
+
* `changes` usually arrives as `{ field: [old, new] }`, which reads far better
|
|
225439
|
+
* as a before/after table than as a JSON tree. Fields that don't match the
|
|
225440
|
+
* tuple shape (nested objects, single values, longer arrays) fall through to
|
|
225441
|
+
* the generic renderer, so a schema drift degrades instead of breaking.
|
|
225442
|
+
*/
|
|
225443
|
+
function AuditLogChangesView({ changes }) {
|
|
225444
|
+
const t = useT();
|
|
225445
|
+
if (!isPlainObject(changes) || Object.keys(changes).length === 0) {
|
|
225446
|
+
return (jsx(AuditLogJsonView, { value: changes, emptyLabel: t('analyticsAuditLogJsonView.noChanges') }));
|
|
225447
|
+
}
|
|
225448
|
+
const entries = Object.entries(changes);
|
|
225449
|
+
const tupleEntries = entries.filter(([, change]) => Array.isArray(change) && change.length === 2 && !change.some(isBranch));
|
|
225450
|
+
const otherEntries = entries.filter(([key]) => !tupleEntries.some(([k]) => k === key));
|
|
225451
|
+
return (jsxs("div", { className: "space-y-3", children: [tupleEntries.length > 0 && (jsx("div", { className: "overflow-hidden rounded-md border border-gray-200", children: jsxs("table", { className: "w-full table-fixed border-collapse text-left text-xs", children: [jsx("thead", { children: jsxs("tr", { className: "bg-gray-50 text-gray-500", children: [jsx("th", { className: "w-1/3 p-2 font-medium", children: t('analyticsAuditLogJsonView.fieldColumn') }), jsx("th", { className: "w-1/3 p-2 font-medium", children: t('analyticsAuditLogJsonView.beforeColumn') }), jsx("th", { className: "w-1/3 p-2 font-medium", children: t('analyticsAuditLogJsonView.afterColumn') })] }) }), jsx("tbody", { children: tupleEntries.map(([field, change]) => {
|
|
225452
|
+
const [before, after] = change;
|
|
225453
|
+
return (jsxs("tr", { className: "border-t border-gray-200 align-top", children: [jsx("td", { className: "p-2 font-mono break-all text-gray-700", children: field }), jsx("td", { className: "p-2", children: jsx(JsonLeaf, { value: before }) }), jsx("td", { className: "p-2", children: jsx(JsonLeaf, { value: after }) })] }, field));
|
|
225454
|
+
}) })] }) })), otherEntries.length > 0 && jsx(AuditLogJsonView, { value: Object.fromEntries(otherEntries) })] }));
|
|
225455
|
+
}
|
|
225456
|
+
|
|
225457
|
+
/**
|
|
225458
|
+
* Formatting helpers shared by the platform-scoped audit trail views.
|
|
225459
|
+
*
|
|
225460
|
+
* Timestamps are rendered through `Intl.DateTimeFormat` with an explicit
|
|
225461
|
+
* `timeZone` rather than the browser default, so an admin reviewing a trail
|
|
225462
|
+
* reads the times in the platform's zone wherever they happen to be sitting.
|
|
225463
|
+
*/
|
|
225464
|
+
const UTC = 'UTC';
|
|
225465
|
+
/** `Intl` throws on an unknown zone, so probe before trusting a value. */
|
|
225466
|
+
function isValidTimeZone(value) {
|
|
225467
|
+
if (!value)
|
|
225468
|
+
return false;
|
|
225469
|
+
try {
|
|
225470
|
+
new Intl.DateTimeFormat(undefined, { timeZone: value });
|
|
225471
|
+
return true;
|
|
225472
|
+
}
|
|
225473
|
+
catch (_a) {
|
|
225474
|
+
return false;
|
|
225475
|
+
}
|
|
225476
|
+
}
|
|
225477
|
+
/**
|
|
225478
|
+
* Picks the zone to render in: the platform's configured zone when the host
|
|
225479
|
+
* supplies one, then the viewer's own zone, and UTC as the last resort so the
|
|
225480
|
+
* column is never ambiguous.
|
|
225481
|
+
*/
|
|
225482
|
+
function resolveAuditTimeZone(preferred) {
|
|
225483
|
+
if (isValidTimeZone(preferred))
|
|
225484
|
+
return preferred;
|
|
225485
|
+
try {
|
|
225486
|
+
const local = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
225487
|
+
if (isValidTimeZone(local))
|
|
225488
|
+
return local;
|
|
225489
|
+
}
|
|
225490
|
+
catch (_a) {
|
|
225491
|
+
/* fall through to UTC */
|
|
225492
|
+
}
|
|
225493
|
+
return UTC;
|
|
225494
|
+
}
|
|
225495
|
+
/** e.g. `Jan 15, 2024, 10:30 AM`. Returns the raw input if it can't be parsed. */
|
|
225496
|
+
function formatAuditTimestamp(timestamp, timeZone) {
|
|
225497
|
+
const date = new Date(timestamp);
|
|
225498
|
+
if (Number.isNaN(date.getTime()))
|
|
225499
|
+
return timestamp;
|
|
225500
|
+
try {
|
|
225501
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
225502
|
+
timeZone,
|
|
225503
|
+
year: 'numeric',
|
|
225504
|
+
month: 'short',
|
|
225505
|
+
day: '2-digit',
|
|
225506
|
+
hour: 'numeric',
|
|
225507
|
+
minute: '2-digit',
|
|
225508
|
+
second: '2-digit',
|
|
225509
|
+
}).format(date);
|
|
225510
|
+
}
|
|
225511
|
+
catch (_a) {
|
|
225512
|
+
return date.toISOString();
|
|
225513
|
+
}
|
|
225514
|
+
}
|
|
225515
|
+
/** Short zone name (`EST`, `GMT+1`) used to label the timestamp column. */
|
|
225516
|
+
function formatTimeZoneLabel(timeZone) {
|
|
225517
|
+
var _a, _b;
|
|
225518
|
+
try {
|
|
225519
|
+
const parts = new Intl.DateTimeFormat('en-US', {
|
|
225520
|
+
timeZone,
|
|
225521
|
+
timeZoneName: 'short',
|
|
225522
|
+
}).formatToParts(new Date());
|
|
225523
|
+
return (_b = (_a = parts.find((part) => part.type === 'timeZoneName')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : timeZone;
|
|
225524
|
+
}
|
|
225525
|
+
catch (_c) {
|
|
225526
|
+
return timeZone;
|
|
225527
|
+
}
|
|
225528
|
+
}
|
|
225529
|
+
/**
|
|
225530
|
+
* Humanizes the snake_case identifiers the backend sends for `event_type` and
|
|
225531
|
+
* `resource_type`. Unknown values still render readably instead of raw, which
|
|
225532
|
+
* matters because the manual event list grows server-side.
|
|
225533
|
+
*/
|
|
225534
|
+
function humanizeAuditToken(token) {
|
|
225535
|
+
const words = token
|
|
225536
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1_$2')
|
|
225537
|
+
.toLowerCase()
|
|
225538
|
+
.split(/[^a-z0-9]+/)
|
|
225539
|
+
.filter(Boolean);
|
|
225540
|
+
if (words.length === 0)
|
|
225541
|
+
return token;
|
|
225542
|
+
const [first, ...rest] = words;
|
|
225543
|
+
return [first.charAt(0).toUpperCase() + first.slice(1), ...rest].join(' ');
|
|
225544
|
+
}
|
|
225545
|
+
|
|
225546
|
+
function usePlatformAuditLabels() {
|
|
225547
|
+
const t = useT();
|
|
225548
|
+
const eventTypeLabels = {
|
|
225549
|
+
login: t('analyticsUsePlatformAuditLabels.eventTypeLogin'),
|
|
225550
|
+
logout: t('analyticsUsePlatformAuditLabels.eventTypeLogout'),
|
|
225551
|
+
login_failed: t('analyticsUsePlatformAuditLabels.eventTypeLoginFailed'),
|
|
225552
|
+
password_change: t('analyticsUsePlatformAuditLabels.eventTypePasswordChange'),
|
|
225553
|
+
export: t('analyticsUsePlatformAuditLabels.eventTypeExport'),
|
|
225554
|
+
download_file: t('analyticsUsePlatformAuditLabels.eventTypeDownloadFile'),
|
|
225555
|
+
api_call: t('analyticsUsePlatformAuditLabels.eventTypeApiCall'),
|
|
225556
|
+
view_student_record: t('analyticsUsePlatformAuditLabels.eventTypeViewStudentRecord'),
|
|
225557
|
+
change_grade: t('analyticsUsePlatformAuditLabels.eventTypeChangeGrade'),
|
|
225558
|
+
admin_action: t('analyticsUsePlatformAuditLabels.eventTypeAdminAction'),
|
|
225559
|
+
};
|
|
225560
|
+
const actionLabels = {
|
|
225561
|
+
create: t('analyticsUsePlatformAuditLabels.actionCreate'),
|
|
225562
|
+
update: t('analyticsUsePlatformAuditLabels.actionUpdate'),
|
|
225563
|
+
delete: t('analyticsUsePlatformAuditLabels.actionDelete'),
|
|
225564
|
+
access: t('analyticsUsePlatformAuditLabels.actionAccess'),
|
|
225565
|
+
};
|
|
225566
|
+
return {
|
|
225567
|
+
eventTypeLabel: (eventType) => { var _a; return (_a = eventTypeLabels[eventType]) !== null && _a !== void 0 ? _a : humanizeAuditToken(eventType); },
|
|
225568
|
+
actionLabel: (action) => { var _a; return (_a = actionLabels[action]) !== null && _a !== void 0 ? _a : humanizeAuditToken(action); },
|
|
225569
|
+
};
|
|
225570
|
+
}
|
|
225571
|
+
|
|
225572
|
+
function DetailRow({ label, value }) {
|
|
225573
|
+
return (jsxs("div", { className: "grid grid-cols-[minmax(0,7rem)_1fr] gap-3 py-2", children: [jsx("dt", { className: "text-xs font-medium tracking-wide text-gray-500 uppercase", children: label }), jsx("dd", { className: "text-sm break-words text-gray-800", children: value })] }));
|
|
225574
|
+
}
|
|
225575
|
+
/**
|
|
225576
|
+
* Read-only detail view for a single audit entry. Which payload it shows is
|
|
225577
|
+
* decided by the `event_type === null` branch: CRUD entries get the field-level
|
|
225578
|
+
* `changes` diff, manual events get their `metadata`.
|
|
225579
|
+
*/
|
|
225580
|
+
function PlatformAuditLogDetailSheet({ entry, open, onOpenChange, timeZone, }) {
|
|
225581
|
+
const t = useT();
|
|
225582
|
+
const { eventTypeLabel, actionLabel } = usePlatformAuditLabels();
|
|
225583
|
+
const isCrudEntry = entry ? entry.event_type === null : false;
|
|
225584
|
+
const placeholder = t('analyticsPlatformAuditLogDetailSheet.notAvailable');
|
|
225585
|
+
return (jsx(Sheet, { open: open, onOpenChange: onOpenChange, children: jsxs(SheetContent, { side: "right", className: "w-full overflow-y-auto sm:max-w-xl", "data-testid": "platform-audit-detail", children: [jsxs(SheetHeader, { children: [jsx(SheetTitle, { children: t('analyticsPlatformAuditLogDetailSheet.title') }), jsx(SheetDescription, { children: t('analyticsPlatformAuditLogDetailSheet.description') })] }), entry && (jsxs("div", { className: "space-y-6 px-4 pb-6", children: [jsxs("dl", { className: "divide-y divide-gray-100", children: [jsx(DetailRow, { label: t('analyticsPlatformAuditLogDetailSheet.timestamp'), value: formatAuditTimestamp(entry.timestamp, timeZone) }), jsx(DetailRow, { label: isCrudEntry
|
|
225586
|
+
? t('analyticsPlatformAuditLogDetailSheet.action')
|
|
225587
|
+
: t('analyticsPlatformAuditLogDetailSheet.event'), value: isCrudEntry ? actionLabel(entry.action) : eventTypeLabel(String(entry.event_type)) }), !isCrudEntry && (jsx(DetailRow, { label: t('analyticsPlatformAuditLogDetailSheet.action'), value: actionLabel(entry.action) })), jsx(DetailRow, { label: t('analyticsPlatformAuditLogDetailSheet.actor'), value: entry.actor_username || entry.actor_email ? (jsxs("span", { className: "flex flex-col", children: [entry.actor_username && jsx("span", { children: entry.actor_username }), entry.actor_email && (jsx("span", { className: "text-xs text-gray-500", children: entry.actor_email }))] })) : (placeholder) }), isCrudEntry && (jsx(DetailRow, { label: t('analyticsPlatformAuditLogDetailSheet.resource'), value: entry.resource_type || entry.resource_repr ? (jsxs("span", { className: "flex flex-col", children: [entry.resource_repr && jsx("span", { children: entry.resource_repr }), jsx("span", { className: "text-xs text-gray-500", children: [
|
|
225588
|
+
entry.resource_type ? humanizeAuditToken(entry.resource_type) : null,
|
|
225589
|
+
entry.resource_id ? `#${entry.resource_id}` : null,
|
|
225590
|
+
]
|
|
225591
|
+
.filter(Boolean)
|
|
225592
|
+
.join(' ') })] })) : (placeholder) })), jsx(DetailRow, { label: t('analyticsPlatformAuditLogDetailSheet.ipAddress'), value: entry.remote_addr || placeholder }), jsx(DetailRow, { label: t('analyticsPlatformAuditLogDetailSheet.entryId'), value: String(entry.id) })] }), jsxs("div", { className: "space-y-2", children: [jsx("h3", { className: "text-sm font-semibold text-gray-800", children: isCrudEntry
|
|
225593
|
+
? t('analyticsPlatformAuditLogDetailSheet.changesHeading')
|
|
225594
|
+
: t('analyticsPlatformAuditLogDetailSheet.metadataHeading') }), isCrudEntry ? (jsx(AuditLogChangesView, { changes: entry.changes })) : (jsx(AuditLogJsonView, { value: entry.metadata, emptyLabel: t('analyticsPlatformAuditLogDetailSheet.noMetadata') }))] })] }))] }) }));
|
|
225595
|
+
}
|
|
225596
|
+
|
|
225597
|
+
/** Rows per request. Kept well under the backend's 1000 cap. */
|
|
225598
|
+
const PLATFORM_AUDIT_PAGE_SIZE = 25;
|
|
225599
|
+
/**
|
|
225600
|
+
* Above this many matching entries, deep paging stops being practical (the
|
|
225601
|
+
* endpoint only offers limit/offset). The UI uses this to nudge the user
|
|
225602
|
+
* toward narrowing by date instead of walking thousands of pages.
|
|
225603
|
+
*/
|
|
225604
|
+
const PLATFORM_AUDIT_DEEP_PAGING_THRESHOLD = 1000;
|
|
225605
|
+
const TEXT_FILTER_DEBOUNCE_MS = 400;
|
|
225606
|
+
const EMPTY_FILTERS = {
|
|
225607
|
+
eventType: '',
|
|
225608
|
+
action: undefined,
|
|
225609
|
+
actorUsername: '',
|
|
225610
|
+
actorEmail: '',
|
|
225611
|
+
dateRange: undefined,
|
|
225612
|
+
};
|
|
225613
|
+
/**
|
|
225614
|
+
* `from_date`/`to_date` are whole-day bounds, so the local calendar day the
|
|
225615
|
+
* user picked is what we send — `toISOString()` would shift the date backwards
|
|
225616
|
+
* for anyone west of UTC.
|
|
225617
|
+
*/
|
|
225618
|
+
const formatDateToYYYYMMDD = (date) => {
|
|
225619
|
+
if (!date)
|
|
225620
|
+
return undefined;
|
|
225621
|
+
const year = date.getFullYear();
|
|
225622
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
225623
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
225624
|
+
return `${year}-${month}-${day}`;
|
|
225625
|
+
};
|
|
225626
|
+
/**
|
|
225627
|
+
* Server-side paging + filtering over the platform-scoped audit trail.
|
|
225628
|
+
*
|
|
225629
|
+
* Every page change is a fresh request (`limit`/`offset`); nothing is sliced
|
|
225630
|
+
* client-side. Any filter change resets the offset to 0, so a user who filters
|
|
225631
|
+
* while on page 12 can't land past the end of the new result set.
|
|
225632
|
+
*/
|
|
225633
|
+
const usePlatformAuditLog = ({ platformKey, limit = PLATFORM_AUDIT_PAGE_SIZE, skip = false, }) => {
|
|
225634
|
+
var _a, _b, _c, _d, _e;
|
|
225635
|
+
const [page, setPage] = useState(1);
|
|
225636
|
+
const [filters, setFilters] = useState(EMPTY_FILTERS);
|
|
225637
|
+
// Typing in the username/email boxes shouldn't fire a request per keystroke,
|
|
225638
|
+
// but the inputs still have to stay responsive — so the committed value the
|
|
225639
|
+
// query reads lags behind the value the inputs render.
|
|
225640
|
+
const [debouncedText, setDebouncedText] = useState({ actorUsername: '', actorEmail: '' });
|
|
225641
|
+
useEffect(() => {
|
|
225642
|
+
const timer = setTimeout(() => {
|
|
225643
|
+
setDebouncedText({
|
|
225644
|
+
actorUsername: filters.actorUsername.trim(),
|
|
225645
|
+
actorEmail: filters.actorEmail.trim(),
|
|
225646
|
+
});
|
|
225647
|
+
}, TEXT_FILTER_DEBOUNCE_MS);
|
|
225648
|
+
return () => clearTimeout(timer);
|
|
225649
|
+
}, [filters.actorUsername, filters.actorEmail]);
|
|
225650
|
+
const params = useMemo(() => {
|
|
225651
|
+
var _a, _b;
|
|
225652
|
+
return ({
|
|
225653
|
+
limit,
|
|
225654
|
+
offset: (page - 1) * limit,
|
|
225655
|
+
...(filters.eventType ? { event_type: filters.eventType } : {}),
|
|
225656
|
+
...(filters.action !== undefined ? { action: filters.action } : {}),
|
|
225657
|
+
...(debouncedText.actorUsername ? { actor_username: debouncedText.actorUsername } : {}),
|
|
225658
|
+
...(debouncedText.actorEmail ? { actor_email: debouncedText.actorEmail } : {}),
|
|
225659
|
+
...(((_a = filters.dateRange) === null || _a === void 0 ? void 0 : _a.from)
|
|
225660
|
+
? { from_date: formatDateToYYYYMMDD(filters.dateRange.from) }
|
|
225661
|
+
: {}),
|
|
225662
|
+
...(((_b = filters.dateRange) === null || _b === void 0 ? void 0 : _b.to) ? { to_date: formatDateToYYYYMMDD(filters.dateRange.to) } : {}),
|
|
225663
|
+
});
|
|
225664
|
+
}, [
|
|
225665
|
+
limit,
|
|
225666
|
+
page,
|
|
225667
|
+
filters.eventType,
|
|
225668
|
+
filters.action,
|
|
225669
|
+
(_a = filters.dateRange) === null || _a === void 0 ? void 0 : _a.from,
|
|
225670
|
+
(_b = filters.dateRange) === null || _b === void 0 ? void 0 : _b.to,
|
|
225671
|
+
debouncedText.actorUsername,
|
|
225672
|
+
debouncedText.actorEmail,
|
|
225673
|
+
]);
|
|
225674
|
+
const { data, isLoading, isFetching, error } = useGetPlatformAuditLogsQuery({ platformKey, params }, { skip: skip || !platformKey });
|
|
225675
|
+
// The debounced values settle one tick after the raw ones, so resetting the
|
|
225676
|
+
// page inside `setFilter` alone would leave a window where the in-flight
|
|
225677
|
+
// request still carries the old offset. Watching the committed text closes it.
|
|
225678
|
+
const isFirstDebounceRef = useRef(true);
|
|
225679
|
+
useEffect(() => {
|
|
225680
|
+
if (isFirstDebounceRef.current) {
|
|
225681
|
+
isFirstDebounceRef.current = false;
|
|
225682
|
+
return;
|
|
225683
|
+
}
|
|
225684
|
+
setPage(1);
|
|
225685
|
+
}, [debouncedText.actorUsername, debouncedText.actorEmail]);
|
|
225686
|
+
const setFilter = (key, value) => {
|
|
225687
|
+
setFilters((current) => ({ ...current, [key]: value }));
|
|
225688
|
+
setPage(1);
|
|
225689
|
+
};
|
|
225690
|
+
const clearFilters = () => {
|
|
225691
|
+
setFilters(EMPTY_FILTERS);
|
|
225692
|
+
setPage(1);
|
|
225693
|
+
};
|
|
225694
|
+
const totalCount = (_c = data === null || data === void 0 ? void 0 : data.count) !== null && _c !== void 0 ? _c : 0;
|
|
225695
|
+
const totalPages = data ? Math.ceil(totalCount / limit) : 0;
|
|
225696
|
+
const hasActiveFilters = Boolean(filters.eventType) ||
|
|
225697
|
+
filters.action !== undefined ||
|
|
225698
|
+
Boolean(filters.actorUsername) ||
|
|
225699
|
+
Boolean(filters.actorEmail) ||
|
|
225700
|
+
Boolean(((_d = filters.dateRange) === null || _d === void 0 ? void 0 : _d.from) || ((_e = filters.dateRange) === null || _e === void 0 ? void 0 : _e.to));
|
|
225701
|
+
const isForbidden = Boolean(error && 'status' in error && error.status === 403);
|
|
225702
|
+
return {
|
|
225703
|
+
data,
|
|
225704
|
+
isLoading,
|
|
225705
|
+
isFetching,
|
|
225706
|
+
error,
|
|
225707
|
+
isForbidden,
|
|
225708
|
+
page,
|
|
225709
|
+
setPage,
|
|
225710
|
+
limit,
|
|
225711
|
+
totalPages,
|
|
225712
|
+
totalCount,
|
|
225713
|
+
shouldSuggestNarrowing: totalCount > PLATFORM_AUDIT_DEEP_PAGING_THRESHOLD,
|
|
225714
|
+
filters,
|
|
225715
|
+
setFilter,
|
|
225716
|
+
clearFilters,
|
|
225717
|
+
hasActiveFilters,
|
|
225718
|
+
};
|
|
225719
|
+
};
|
|
225720
|
+
|
|
225721
|
+
const ALL_OPTION_VALUE = 'all';
|
|
225722
|
+
const ACTION_OPTION_VALUES = ['create', 'update', 'delete', 'access'];
|
|
225723
|
+
/** Reverse lookup so the select can show the code currently applied. */
|
|
225724
|
+
function actionValueForCode(code) {
|
|
225725
|
+
var _a;
|
|
225726
|
+
if (code === undefined)
|
|
225727
|
+
return ALL_OPTION_VALUE;
|
|
225728
|
+
return ((_a = ACTION_OPTION_VALUES.find((value) => PLATFORM_AUDIT_ACTION_CODES[value] === code)) !== null && _a !== void 0 ? _a : ALL_OPTION_VALUE);
|
|
225729
|
+
}
|
|
225730
|
+
const SKELETON_ROW_KEYS = ['a', 'b', 'c', 'd', 'e'];
|
|
225731
|
+
/** CRUD entries have no `event_type`; that's the branch the whole UI keys off. */
|
|
225732
|
+
function isCrudEntry(entry) {
|
|
225733
|
+
return entry.event_type === null;
|
|
225734
|
+
}
|
|
225735
|
+
function formatActor(entry, placeholder) {
|
|
225736
|
+
if (!entry.actor_username && !entry.actor_email)
|
|
225737
|
+
return null;
|
|
225738
|
+
return (jsxs("span", { className: "flex flex-col", children: [jsx("span", { className: "font-medium text-gray-700", children: entry.actor_username || placeholder }), entry.actor_email && jsx("span", { className: "text-xs text-gray-500", children: entry.actor_email })] }));
|
|
225739
|
+
}
|
|
225740
|
+
function AnalyticsPlatformAuditLog({ platformKey, timezone, }) {
|
|
225741
|
+
var _a, _b, _c;
|
|
225742
|
+
const t = useT();
|
|
225743
|
+
const [selectedEntry, setSelectedEntry] = useState(null);
|
|
225744
|
+
const timeZone = resolveAuditTimeZone(timezone);
|
|
225745
|
+
const timeZoneLabel = formatTimeZoneLabel(timeZone);
|
|
225746
|
+
const placeholder = t('analyticsAnalyticsPlatformAuditLog.notAvailable');
|
|
225747
|
+
const { eventTypeLabel, actionLabel } = usePlatformAuditLabels();
|
|
225748
|
+
const { data, isLoading, isFetching, error, isForbidden, page, setPage, totalPages, totalCount, shouldSuggestNarrowing, filters, setFilter, clearFilters, hasActiveFilters, } = usePlatformAuditLog({ platformKey });
|
|
225749
|
+
// A 403 means the account is signed in but lacks `Ibl.Core/AuditLogs/list` —
|
|
225750
|
+
// a permissions answer, not a failure, so it replaces the whole view rather
|
|
225751
|
+
// than showing an error next to unusable filters.
|
|
225752
|
+
if (isForbidden) {
|
|
225753
|
+
return (jsx(Card, { className: "rounded-lg border border-gray-100 bg-white shadow-sm", children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx("p", { className: "font-medium text-gray-700", children: t('analyticsAnalyticsPlatformAuditLog.forbiddenTitle') }), jsx("p", { className: "mt-1 text-sm text-gray-500", children: t('analyticsAnalyticsPlatformAuditLog.forbiddenBody') })] }) }));
|
|
225754
|
+
}
|
|
225755
|
+
const results = (_a = data === null || data === void 0 ? void 0 : data.results) !== null && _a !== void 0 ? _a : [];
|
|
225756
|
+
const hasError = Boolean(error);
|
|
225757
|
+
return (jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "rounded-lg border border-[oklch(0.922_0_0)] bg-white p-4", children: [jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-5", children: [jsxs(Select$1, { value: filters.eventType || ALL_OPTION_VALUE, onValueChange: (value) => setFilter('eventType', value === ALL_OPTION_VALUE ? '' : value), children: [jsx(SelectTrigger, { className: "h-9 w-full bg-white font-normal", "aria-label": t('analyticsAnalyticsPlatformAuditLog.eventTypeLabel'), children: jsx(SelectValue, { placeholder: t('analyticsAnalyticsPlatformAuditLog.allEventTypes') }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: ALL_OPTION_VALUE, children: t('analyticsAnalyticsPlatformAuditLog.allEventTypes') }), PLATFORM_AUDIT_EVENT_TYPES.map((eventType) => (jsx(SelectItem, { value: eventType, children: eventTypeLabel(eventType) }, eventType)))] })] }), jsxs(Select$1, { value: actionValueForCode(filters.action), onValueChange: (value) => setFilter('action', value === ALL_OPTION_VALUE
|
|
225758
|
+
? undefined
|
|
225759
|
+
: PLATFORM_AUDIT_ACTION_CODES[value]), children: [jsx(SelectTrigger, { className: "h-9 w-full bg-white font-normal", "aria-label": t('analyticsAnalyticsPlatformAuditLog.actionLabel'), children: jsx(SelectValue, { placeholder: t('analyticsAnalyticsPlatformAuditLog.allActions') }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: ALL_OPTION_VALUE, children: t('analyticsAnalyticsPlatformAuditLog.allActions') }), ACTION_OPTION_VALUES.map((value) => (jsx(SelectItem, { value: value, children: actionLabel(value) }, value)))] })] }), jsx(Input, { className: "h-9 bg-white", value: filters.actorUsername, onChange: (event) => setFilter('actorUsername', event.target.value), placeholder: t('analyticsAnalyticsPlatformAuditLog.actorUsernamePlaceholder'), "aria-label": t('analyticsAnalyticsPlatformAuditLog.actorUsernameLabel') }), jsx(Input, { className: "h-9 bg-white", type: "email", value: filters.actorEmail, onChange: (event) => setFilter('actorEmail', event.target.value), placeholder: t('analyticsAnalyticsPlatformAuditLog.actorEmailPlaceholder'), "aria-label": t('analyticsAnalyticsPlatformAuditLog.actorEmailLabel') }), jsxs(Popover, { modal: true, children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", className: "h-9 w-full justify-start gap-2 bg-white font-normal whitespace-nowrap", children: [jsx(Calendar$1, { className: "h-4 w-4" }), ((_b = filters.dateRange) === null || _b === void 0 ? void 0 : _b.from) && ((_c = filters.dateRange) === null || _c === void 0 ? void 0 : _c.to)
|
|
225760
|
+
? `${format$1(filters.dateRange.from, 'MMM dd')} - ${format$1(filters.dateRange.to, 'MMM dd')}`
|
|
225761
|
+
: t('analyticsAnalyticsPlatformAuditLog.pickDateRange')] }) }), jsx(PopoverContent, { "data-iblai-dialog-interaction-layer": true, className: "z-[60] w-auto p-0", align: "start", children: jsx(Calendar, { mode: "range", selected: filters.dateRange, onSelect: (range) => setFilter('dateRange', range ? { from: range.from, to: range.to } : undefined), numberOfMonths: 2 }) })] })] }), hasActiveFilters && (jsx("div", { className: "mt-3 flex justify-end", children: jsxs(Button$1, { variant: "ghost", size: "sm", onClick: clearFilters, className: "h-8 text-gray-600", children: [jsx(X$1, { className: "mr-1 h-3.5 w-3.5" }), t('analyticsAnalyticsPlatformAuditLog.clearFilters')] }) }))] }), shouldSuggestNarrowing && !hasError && (jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-blue-100 bg-blue-50 p-3 text-sm text-blue-900", children: [jsx(Info$3, { className: "mt-0.5 h-4 w-4 shrink-0", "aria-hidden": "true" }), jsx("p", { children: t('analyticsAnalyticsPlatformAuditLog.narrowSuggestion', { count: totalCount }) })] })), jsx("div", { className: "overflow-hidden rounded-md border border-[oklch(0.922_0_0)] bg-white", children: jsx("div", { className: "overflow-x-auto", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isLoading ? (jsx("div", { className: "space-y-3 p-4", "data-testid": "platform-audit-skeleton", children: SKELETON_ROW_KEYS.map((key) => (jsx(Skeleton, { className: "h-10 w-full" }, key))) })) : hasError ? (jsx("div", { className: "py-8 text-center text-[#646464]", children: t('analyticsAnalyticsPlatformAuditLog.loadError') })) : results.length === 0 ? (jsx("div", { className: "h-[120px]", children: jsx(EmptyStats, { title: hasActiveFilters
|
|
225762
|
+
? t('analyticsAnalyticsPlatformAuditLog.noFilteredEntries')
|
|
225763
|
+
: t('analyticsAnalyticsPlatformAuditLog.noEntries') }) })) : (jsxs(Table, { className: "min-w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "bg-muted/50 border-b border-[oklch(0.922_0_0)]", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsPlatformAuditLog.colTimestamp', {
|
|
225764
|
+
timezone: timeZoneLabel,
|
|
225765
|
+
}) }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsPlatformAuditLog.colEvent') }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsPlatformAuditLog.colActor') }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsPlatformAuditLog.colResource') }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsPlatformAuditLog.colIpAddress') }), jsx(TableHead, { className: "p-3 text-right text-sm whitespace-nowrap text-[#646464]", children: jsx("span", { className: "sr-only", children: t('analyticsAnalyticsPlatformAuditLog.colDetails') }) })] }) }), jsx(TableBody, { children: results.map((entry) => {
|
|
225766
|
+
const crud = isCrudEntry(entry);
|
|
225767
|
+
const actor = formatActor(entry, placeholder);
|
|
225768
|
+
return (jsxs(TableRow, { className: "border-b border-[oklch(0.922_0_0)] last:border-0", children: [jsx(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: formatAuditTimestamp(entry.timestamp, timeZone) }), jsx(TableCell, { className: "p-3 text-[#646464]", children: jsxs("span", { className: "flex flex-col", children: [jsx("span", { className: "font-medium text-gray-700", children: crud
|
|
225769
|
+
? actionLabel(entry.action)
|
|
225770
|
+
: eventTypeLabel(String(entry.event_type)) }), jsx("span", { className: "text-xs text-gray-500", children: crud
|
|
225771
|
+
? t('analyticsAnalyticsPlatformAuditLog.kindModelChange')
|
|
225772
|
+
: t('analyticsAnalyticsPlatformAuditLog.kindEvent') })] }) }), jsx(TableCell, { className: "p-3 text-[#646464]", children: actor !== null && actor !== void 0 ? actor : placeholder }), jsx(TableCell, { className: "min-w-[200px] p-3 text-[#646464]", children: entry.resource_repr || entry.resource_type ? (jsxs("span", { className: "flex flex-col", children: [jsx("span", { children: entry.resource_repr || placeholder }), entry.resource_type && (jsx("span", { className: "text-xs text-gray-500", children: humanizeAuditToken(entry.resource_type) }))] })) : (placeholder) }), jsx(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: entry.remote_addr || placeholder }), jsx(TableCell, { className: "p-3 text-right whitespace-nowrap", children: jsx(Button$1, { variant: "ghost", size: "sm", className: "h-8 text-blue-600", onClick: () => setSelectedEntry(entry), children: t('analyticsAnalyticsPlatformAuditLog.viewDetails') }) })] }, entry.id));
|
|
225773
|
+
}) })] })) }) }) }), !hasError && results.length > 0 && (jsx("p", { className: "text-xs text-gray-500", children: t('analyticsAnalyticsPlatformAuditLog.resultSummary', {
|
|
225774
|
+
shown: results.length,
|
|
225775
|
+
total: totalCount,
|
|
225776
|
+
}) })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: isFetching }), jsx(PlatformAuditLogDetailSheet, { entry: selectedEntry, open: selectedEntry !== null, onOpenChange: (open) => {
|
|
225777
|
+
if (!open)
|
|
225778
|
+
setSelectedEntry(null);
|
|
225779
|
+
}, timeZone: timeZone })] }));
|
|
225780
|
+
}
|
|
225781
|
+
|
|
224987
225782
|
const ACTION_LABELS = {
|
|
224988
225783
|
create: 'Created',
|
|
224989
225784
|
update: 'Updated',
|
|
@@ -225131,7 +225926,8 @@ function summarizeChanges(entry) {
|
|
|
225131
225926
|
}
|
|
225132
225927
|
return `${action} ${target}`;
|
|
225133
225928
|
}
|
|
225134
|
-
|
|
225929
|
+
/** The per-agent change log — the original audit view, unchanged. */
|
|
225930
|
+
function AgentAuditLogView({ tenantKey, mentorId, userId, selectedMentorId, }) {
|
|
225135
225931
|
var _a;
|
|
225136
225932
|
const t = useT();
|
|
225137
225933
|
const currentMentorId = selectedMentorId || mentorId;
|
|
@@ -225171,6 +225967,22 @@ function AnalyticsAuditLogStats({ tenantKey, mentorId, userId, selectedMentorId,
|
|
|
225171
225967
|
setPage(1);
|
|
225172
225968
|
}, children: [jsx(SelectTrigger, { className: "w-full font-normal bg-white h-9", children: jsx(SelectValue, { placeholder: t('analyticsAnalyticsAuditLogStats.allActions') }) }), jsx(SelectContent, { children: ACTION_FILTER_OPTIONS.map((opt) => (jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value))) })] }) })] }) }), jsx("div", { className: "overflow-hidden rounded-md border border-[oklch(0.922_0_0)] bg-white", children: jsx("div", { className: "overflow-x-auto", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isLoading ? (jsx("div", { className: "flex items-center justify-center w-full py-10", children: jsx("div", { className: "h-6 w-6 animate-spin rounded-full border-2 border-blue-600 border-t-transparent" }) })) : error && !is403 ? (jsx("div", { className: "py-8 text-center text-[#646464]", children: t('analyticsAnalyticsAuditLogStats.loadError') })) : !((_a = data === null || data === void 0 ? void 0 : data.results) === null || _a === void 0 ? void 0 : _a.length) ? (jsx("div", { className: "h-[120px]", children: jsx(EmptyStats, { title: t('analyticsAnalyticsAuditLogStats.noEntries') }) })) : (jsxs(Table, { className: "min-w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "bg-muted/50 border-b border-[oklch(0.922_0_0)]", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsAuditLogStats.colUser') }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsAuditLogStats.colAction') }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: t('analyticsAnalyticsAuditLogStats.colTime') })] }) }), jsx(TableBody, { children: data.results.map((entry) => (jsxs(TableRow, { className: "border-b border-[oklch(0.922_0_0)] last:border-0", children: [jsx(TableCell, { className: "p-3 font-medium whitespace-nowrap text-[#646464]", children: entry.actor_email }), jsx(TableCell, { className: "min-w-[250px] p-3 text-[#646464]", children: summarizeChanges(entry) }), jsx(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: formatDistanceToNow(new Date(entry.timestamp), { addSuffix: true }) })] }, entry.id))) })] })) }) }) }), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: isLoading })] }));
|
|
225173
225969
|
}
|
|
225970
|
+
function AnalyticsAuditLogStats({ tenantKey, mentorId, userId, selectedMentorId, defaultScope = 'agent', timezone, canViewPlatformAudit, }) {
|
|
225971
|
+
const t = useT();
|
|
225972
|
+
const { currentTenant } = useCurrentTenant();
|
|
225973
|
+
const rbacPermissions = useSelector(selectRbacPermissions);
|
|
225974
|
+
// Mirrors how the backend gates the endpoint (RBAC action, or platform admin
|
|
225975
|
+
// on non-RBAC deployments). Hiding the toggle is UX/defense-in-depth only —
|
|
225976
|
+
// the API answers 403 on its own regardless of what renders here.
|
|
225977
|
+
const canSeePlatformScope = canViewPlatformAudit !== null && canViewPlatformAudit !== void 0 ? canViewPlatformAudit : canViewPlatformAuditLogs(rbacPermissions, currentTenant);
|
|
225978
|
+
const [scope, setScope] = useState(defaultScope === 'platform' && !canSeePlatformScope ? 'agent' : defaultScope);
|
|
225979
|
+
// A user who loses the permission mid-session (tenant switch, role change)
|
|
225980
|
+
// must not be left staring at a trail they can no longer read.
|
|
225981
|
+
const activeScope = scope === 'platform' && !canSeePlatformScope ? 'agent' : scope;
|
|
225982
|
+
return (jsxs("div", { className: "space-y-4", children: [canSeePlatformScope && (jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [jsx(Tabs, { value: activeScope, className: "w-full sm:w-auto", children: jsxs(TabsList, { className: "h-auto gap-2 sm:grid sm:h-[35px] sm:w-fit sm:grid-cols-2 sm:gap-0", children: [jsx(TabsTrigger, { value: "agent", className: activeScope === 'agent' ? 'w-full' : undefined, onClick: () => setScope('agent'), children: t('analyticsAnalyticsAuditLogStats.scopeAgent') }), jsx(TabsTrigger, { value: "platform", className: activeScope === 'platform' ? 'w-full' : undefined, onClick: () => setScope('platform'), children: t('analyticsAnalyticsAuditLogStats.scopePlatform') })] }) }), jsx("p", { className: "hidden text-xs text-gray-500 sm:block", children: activeScope === 'agent'
|
|
225983
|
+
? t('analyticsAnalyticsAuditLogStats.scopeAgentHint')
|
|
225984
|
+
: t('analyticsAnalyticsAuditLogStats.scopePlatformHint') })] })), activeScope === 'platform' ? (jsx(AnalyticsPlatformAuditLog, { platformKey: tenantKey, timezone: timezone })) : (jsx(AgentAuditLogView, { tenantKey: tenantKey, mentorId: mentorId, userId: userId, selectedMentorId: selectedMentorId }))] }));
|
|
225985
|
+
}
|
|
225174
225986
|
|
|
225175
225987
|
/**
|
|
225176
225988
|
* Core agent search hook — thin wrapper around `useGetAiSearchMentorsQuery`.
|
|
@@ -228289,30 +229101,6 @@ const CourseOutline = () => {
|
|
|
228289
229101
|
: 'text-gray-600 hover:bg-gray-50'}`, children: [jsx("div", { className: "mr-2 flex-shrink-0", children: jsx(CompletionIcon, { node: sublesson }) }), jsx("span", { children: sublesson.display_name })] }, sublesson.id))) }))] }, lesson.id))) }))] }, module.id)))) }));
|
|
228290
229102
|
};
|
|
228291
229103
|
|
|
228292
|
-
function Sheet({ ...props }) {
|
|
228293
|
-
return jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
228294
|
-
}
|
|
228295
|
-
function SheetPortal({ ...props }) {
|
|
228296
|
-
return jsx(DialogPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
228297
|
-
}
|
|
228298
|
-
function SheetOverlay({ className, ...props }) {
|
|
228299
|
-
return (jsx(DialogPrimitive.Overlay, { "data-slot": "sheet-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50', className), ...props }));
|
|
228300
|
-
}
|
|
228301
|
-
function SheetContent({ className, children, side = 'right', ...props }) {
|
|
228302
|
-
const t = useT();
|
|
228303
|
-
return (jsxs(SheetPortal, { children: [jsx(SheetOverlay, {}), jsxs(DialogPrimitive.Content, { "data-slot": "sheet-content", className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500', side === 'right' &&
|
|
228304
|
-
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm', side === 'left' &&
|
|
228305
|
-
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm', side === 'top' &&
|
|
228306
|
-
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b', side === 'bottom' &&
|
|
228307
|
-
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t', className), ...props, children: [children, jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [jsx(X$1, { className: "size-4" }), jsx("span", { className: "sr-only", children: t('uiSheet.close') })] })] })] }));
|
|
228308
|
-
}
|
|
228309
|
-
function SheetHeader({ className, ...props }) {
|
|
228310
|
-
return (jsx("div", { "data-slot": "sheet-header", className: cn('flex flex-col gap-1.5 p-4', className), ...props }));
|
|
228311
|
-
}
|
|
228312
|
-
function SheetTitle({ className, ...props }) {
|
|
228313
|
-
return (jsx(DialogPrimitive.Title, { "data-slot": "sheet-title", className: cn('text-foreground font-semibold', className), ...props }));
|
|
228314
|
-
}
|
|
228315
|
-
|
|
228316
229104
|
/**
|
|
228317
229105
|
* Mobile drawer wrapping `<CourseOutline />` in a `Sheet` for responsive
|
|
228318
229106
|
* course navigation. Ported from skillsai's `course-outline-drawer.tsx`.
|
|
@@ -236517,5 +237305,5 @@ var trainOrDeleteModal = /*#__PURE__*/Object.freeze({
|
|
|
236517
237305
|
TrainOrDeleteModal: TrainOrDeleteModal
|
|
236518
237306
|
});
|
|
236519
237307
|
|
|
236520
|
-
export { ACCESS_COURSE_LABEL, ALL_CATEGORIES, AccessTimeHeatmap, AccessiblePaginate, AddMentorToProjectModal, AddSkillDialog, Admin, AdvancedTab, AgentConfigPrompts, AgentSkills, AlertsTab, AnalyticsAuditLogStats, AnalyticsCourseDetail, AnalyticsCourses, AnalyticsFinancialStats, AnalyticsLayout, AnalyticsMemoryStats, AnalyticsMonetizationStats, AnalyticsOverview, AnalyticsProgramDetail, AnalyticsPrograms, AnalyticsReportDownload, AnalyticsReports, AnalyticsSettingsProvider, AnalyticsTopicsStats, AnalyticsTranscriptsStats, AnalyticsUsersStats, AppleRestrictionModal, ApplyWizard, BUY_NOW_LABEL, BillingTab, CATALOGS, CREATE_AGENT_LABELS, CUA_DRIVER_REPO_URL, CUA_DRIVER_TAURI_COMMANDS, CUA_DRIVER_TAURI_EVENTS, CardInfoIcon, CategorizedDropdownMenu, ChartCardWrapper, ChartFiltersProvider, ChartLoading, ChatContext, ChatPrivacyToggle, ChatProvider, CompanyDialog, ConnectorManagementDialog, CopyButtonIcon, CourseAccessGuard, CourseCardSkeleton, CourseContentLoading, CourseOutline, CourseOutlineContext, CourseOutlineDrawer, CreateAgentForm, CreateAgentModal, CreateProjectModal, CreateWorkflowModal, CredentialBox, CredentialMiniBoxSkeleton, CredentialsList, CreditBalance, CustomDateRangePicker, CustomTooltip, DEFAULT_COWORK_REQUIRED_SIZE_GB, DEFAULT_LOCALE, DefaultEmptyBox, DeleteProjectModal, DeleteWorkflowModal, DiscoverContentCard, DiscoverFacetsFilter, DiscoverFilterDrawer, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ENROLL_NOW_COURSE_STARTING_SOON_LABEL, ENROLL_NOW_LABEL, EditAlertDialog, EducationBox, EducationDialog, EducationTab, EdxIframeContext, EmptyStats, ExperienceBox, ExperienceDialog, ExperienceTab, FacetFilterContext, Footer, GradebookTab, GroupsFilterDropdown, INVITATION_ONLY_LABEL, InstitutionDialog, IntegrationsTab, InviteUserContent, InviteUserDialog, InvitedUsersDialog, LOCAL_MODELS, Loader, LocalLLMTab, LocalModelsContent, LoginButton, MACOS_PERMISSIONS_COMMANDS, MEMORY_PAGE_SIZE, Markdown, MinimumMentorAlert, MonetizationTab, NotificationDisplay, NotificationDropdown, ONBOARDING_SECTORS, OnboardingShell, OnboardingWizard, PaywallModal, PlacementExam, PlacementExamsDropdown, PlatformNavbar, PlatformNavbarSearch, Profile, ProfileTimeChart, ProgressDots, ProjectActionButtons, ProjectFilesModal, ProjectInstructionsModal, ProjectLandingPage, ProjectMentorsList, ProjectsPage, REQUEST_ACCESS_COURSE_STARTING_SOON_LABEL, REQUEST_ACCESS_LABEL, RenameProjectModal, ResumeBox, ResumeTab, RichTextEditor, SUPPORTED_LOCALES, SandboxConfig, SearchableMultiSelect, SendNotificationDialog, SignupButton, SkeletonActivityStatBox, SkeletonAddSkillsLoading, SkeletonCreatePathwaySearchList, SkeletonDiscoverFilterBox, SkeletonEducationBox, SkeletonMultiplier, SkeletonPathwayBox, SkeletonProfileInfoCard, SkeletonSkillBox, SkillBox, SkillDetailModal, SkillLeaderboardChart, SkillsBox, SkillsList, SlashSkillPicker, Spinner, StatCard, StepHeader, TAURI_COMMANDS, TAURI_EVENTS, TenantSwitcher, TimeFilter, TimeTrackingProvider, TimedExam, ToolDialogs, TopBanner, UpgradePackageModal, UserAvatar, Version, WebContainersI18nProvider, WorkflowSidebar, addBookmarksTab, availablePlacementExams, findLastResumeBlock, findSequentialParent, flattenVerticalBlocks, getCatalog, getFirstAvailableUnit, getLocalLLMModel, getLocalLLMToolSupport, getNextUnitIframe, getOrg, getParentBlockById, getParentsInfosFromSublessonId, getPreviousUnitIframe, getRandomCourseImage, getSectorById, getTenant, getUnitToIframe, getUserId, getUserName, inBrowserPrint, inIframe, initialCuaDriverInstallState, initialModelDownloadState, isCoworkEnabled, isLocalLLMEnabled, isPlatformNavbarCreditBalanceVisible, isSlashCommandToken, isTauriApp, isValidLocale, components as markdownComponents, modelSupportsCowork, onboardingPrimaryButtonClass, onboardingSecondaryButtonClass, resolveCreateAgentLabels, sanitizeCss, setCoworkEnabled, setLocalLLMEnabled, setLocalLLMModel, setLocalLLMToolSupport, smallestCoworkModel, useAnalyticsSettings, useAuditLog, useCatalogSearch, useChartFilters, useChatPrivacy, useChatState, useCourseDetail, useCourseMetadata, useCourses, useCuaDriver, useDiscover, useEdxIframe, useFinancial, useIframeMessageHandler, useLocalStorage, useMemory, useModelDownload, useMonetization, useOverview, useProfileActivityStats, useProfileCredentials, useProfilePathways, useProfilePrograms, useProfileSkills, useProfileTimeSpent, usePrograms, useReports, useSlashSkillPicker, useSlashSkills, useT, useTauri, useTimeTracking, useTopics, useTranscripts, useUserCourses, useUserMetadata, useUsers, useWebContainersI18n, useWebContainersLocale };
|
|
237308
|
+
export { ACCESS_COURSE_LABEL, ALL_CATEGORIES, AccessTimeHeatmap, AccessiblePaginate, AddMentorToProjectModal, AddSkillDialog, Admin, AdvancedTab, AgentConfigPrompts, AgentSkills, AlertsTab, AnalyticsAuditLogStats, AnalyticsCourseDetail, AnalyticsCourses, AnalyticsFinancialStats, AnalyticsLayout, AnalyticsMemoryStats, AnalyticsMonetizationStats, AnalyticsOverview, AnalyticsPlatformAuditLog, AnalyticsProgramDetail, AnalyticsPrograms, AnalyticsReportDownload, AnalyticsReports, AnalyticsSettingsProvider, AnalyticsTopicsStats, AnalyticsTranscriptsStats, AnalyticsUsersStats, AppleRestrictionModal, ApplyWizard, AuditLogChangesView, AuditLogJsonView, BUY_NOW_LABEL, BillingTab, CATALOGS, CREATE_AGENT_LABELS, CUA_DRIVER_REPO_URL, CUA_DRIVER_TAURI_COMMANDS, CUA_DRIVER_TAURI_EVENTS, CardInfoIcon, CategorizedDropdownMenu, ChartCardWrapper, ChartFiltersProvider, ChartLoading, ChatContext, ChatPrivacyToggle, ChatProvider, CompanyDialog, ConnectorManagementDialog, CopyButtonIcon, CourseAccessGuard, CourseCardSkeleton, CourseContentLoading, CourseOutline, CourseOutlineContext, CourseOutlineDrawer, CreateAgentForm, CreateAgentModal, CreateProjectModal, CreateWorkflowModal, CredentialBox, CredentialMiniBoxSkeleton, CredentialsList, CreditBalance, CustomDateRangePicker, CustomTooltip, DEFAULT_COWORK_REQUIRED_SIZE_GB, DEFAULT_LOCALE, DefaultEmptyBox, DeleteProjectModal, DeleteWorkflowModal, DiscoverContentCard, DiscoverFacetsFilter, DiscoverFilterDrawer, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ENROLL_NOW_COURSE_STARTING_SOON_LABEL, ENROLL_NOW_LABEL, EditAlertDialog, EducationBox, EducationDialog, EducationTab, EdxIframeContext, EmptyStats, ExperienceBox, ExperienceDialog, ExperienceTab, FacetFilterContext, Footer, GradebookTab, GroupsFilterDropdown, INVITATION_ONLY_LABEL, InstitutionDialog, IntegrationsTab, InviteUserContent, InviteUserDialog, InvitedUsersDialog, LOCAL_MODELS, Loader, LocalLLMTab, LocalModelsContent, LoginButton, MACOS_PERMISSIONS_COMMANDS, MEMORY_PAGE_SIZE, Markdown, MinimumMentorAlert, MonetizationTab, NotificationDisplay, NotificationDropdown, ONBOARDING_SECTORS, OnboardingShell, OnboardingWizard, PLATFORM_AUDIT_DEEP_PAGING_THRESHOLD, PLATFORM_AUDIT_PAGE_SIZE, PaywallModal, PlacementExam, PlacementExamsDropdown, PlatformAuditLogDetailSheet, PlatformNavbar, PlatformNavbarSearch, Profile, ProfileTimeChart, ProgressDots, ProjectActionButtons, ProjectFilesModal, ProjectInstructionsModal, ProjectLandingPage, ProjectMentorsList, ProjectsPage, REQUEST_ACCESS_COURSE_STARTING_SOON_LABEL, REQUEST_ACCESS_LABEL, RenameProjectModal, ResumeBox, ResumeTab, RichTextEditor, SUPPORTED_LOCALES, SandboxConfig, SearchableMultiSelect, SendNotificationDialog, SignupButton, SkeletonActivityStatBox, SkeletonAddSkillsLoading, SkeletonCreatePathwaySearchList, SkeletonDiscoverFilterBox, SkeletonEducationBox, SkeletonMultiplier, SkeletonPathwayBox, SkeletonProfileInfoCard, SkeletonSkillBox, SkillBox, SkillDetailModal, SkillLeaderboardChart, SkillsBox, SkillsList, SlashSkillPicker, Spinner, StatCard, StepHeader, TAURI_COMMANDS, TAURI_EVENTS, TenantSwitcher, TimeFilter, TimeTrackingProvider, TimedExam, ToolDialogs, TopBanner, UpgradePackageModal, UserAvatar, Version, WebContainersI18nProvider, WorkflowSidebar, addBookmarksTab, availablePlacementExams, findLastResumeBlock, findSequentialParent, flattenVerticalBlocks, formatAuditTimestamp, formatTimeZoneLabel, getCatalog, getFirstAvailableUnit, getLocalLLMModel, getLocalLLMToolSupport, getNextUnitIframe, getOrg, getParentBlockById, getParentsInfosFromSublessonId, getPreviousUnitIframe, getRandomCourseImage, getSectorById, getTenant, getUnitToIframe, getUserId, getUserName, humanizeAuditToken, inBrowserPrint, inIframe, initialCuaDriverInstallState, initialModelDownloadState, isCoworkEnabled, isLocalLLMEnabled, isPlatformNavbarCreditBalanceVisible, isSlashCommandToken, isTauriApp, isValidLocale, isValidTimeZone, components as markdownComponents, modelSupportsCowork, onboardingPrimaryButtonClass, onboardingSecondaryButtonClass, resolveAuditTimeZone, resolveCreateAgentLabels, sanitizeCss, setCoworkEnabled, setLocalLLMEnabled, setLocalLLMModel, setLocalLLMToolSupport, smallestCoworkModel, useAnalyticsSettings, useAuditLog, useCatalogSearch, useChartFilters, useChatPrivacy, useChatState, useCourseDetail, useCourseMetadata, useCourses, useCuaDriver, useDiscover, useEdxIframe, useFinancial, useIframeMessageHandler, useLocalStorage, useMemory, useModelDownload, useMonetization, useOverview, usePlatformAuditLabels, usePlatformAuditLog, useProfileActivityStats, useProfileCredentials, useProfilePathways, useProfilePrograms, useProfileSkills, useProfileTimeSpent, usePrograms, useReports, useSlashSkillPicker, useSlashSkills, useT, useTauri, useTimeTracking, useTopics, useTranscripts, useUserCourses, useUserMetadata, useUsers, useWebContainersI18n, useWebContainersLocale };
|
|
236521
237309
|
//# sourceMappingURL=index.esm.js.map
|