feat: remove audit access to learning assistant chat (#1280)

* feat: remove audit access to la

* feat: remove audit access to la
This commit is contained in:
alangsto
2024-01-29 17:08:17 -05:00
committed by GitHub
parent 25d746b7c8
commit 55e2332b00
2 changed files with 5 additions and 12 deletions

View File

@@ -24,17 +24,10 @@ const Chat = ({
'paid-bootcamp',
];
const AUDIT_MODES = [
'audit',
'honor',
'unpaid-executive-education',
'unpaid-bootcamp',
];
const isEnrolled = (
const hasVerifiedEnrollment = (
enrollmentMode !== null
&& enrollmentMode !== undefined
&& [...VERIFIED_MODES, ...AUDIT_MODES].some(mode => mode === enrollmentMode)
&& [...VERIFIED_MODES].some(mode => mode === enrollmentMode)
);
const endDatePassed = () => {
@@ -46,7 +39,7 @@ const Chat = ({
const shouldDisplayChat = (
enabled
&& (isEnrolled || isStaff) // display only to enrolled or staff
&& (hasVerifiedEnrollment || isStaff) // display only to verified learners or staff
&& !endDatePassed()
);

View File

@@ -16,9 +16,9 @@ let enabledTestCases = [];
let disabledTestCases = [];
const enabledModes = [
'professional', 'verified', 'no-id-professional', 'credit', 'masters', 'executive-education',
'paid-executive-education', 'paid-bootcamp', 'audit', 'honor', 'unpaid-executive-education', 'unpaid-bootcamp',
'paid-executive-education', 'paid-bootcamp',
];
const disabledModes = [null, undefined, 'xyz'];
const disabledModes = [null, undefined, 'xyz', 'audit', 'honor', 'unpaid-executive-education', 'unpaid-bootcamp'];
const currentTime = new Date();
describe('Chat', () => {