fix: Update discussion provider featues
Updates "Partial Support" to "Basic Support" Changes "edX" to Full Support. Uses data from the api for support level. Refactor some app messages. https://openedx.atlassian.net/browse/TNL-8546
This commit is contained in:
committed by
Awais Jibran
parent
28107fcd60
commit
6b7f77f4fd
@@ -14,8 +14,7 @@ function AppCard({
|
||||
}) {
|
||||
const supportText = app.hasFullSupport
|
||||
? intl.formatMessage(messages.appFullSupport)
|
||||
: intl.formatMessage(messages.appPartialSupport);
|
||||
|
||||
: intl.formatMessage(messages.appBasicSupport);
|
||||
return (
|
||||
<Card
|
||||
key={app.id}
|
||||
|
||||
@@ -62,10 +62,10 @@ describe('AppCard', () => {
|
||||
});
|
||||
|
||||
test('partial support subtitle shown when hasFullSupport is false', () => {
|
||||
const appWithPartialSupport = { ...app, hasFullSupport: false };
|
||||
const subtitle = messages.appPartialSupport.defaultMessage;
|
||||
const appWithBasicSupport = { ...app, hasFullSupport: false };
|
||||
const subtitle = messages.appBasicSupport.defaultMessage;
|
||||
|
||||
const { container } = wrapper(appWithPartialSupport);
|
||||
const { container } = wrapper(appWithBasicSupport);
|
||||
|
||||
expect(container.querySelector('.card-subtitle')).toHaveTextContent(subtitle);
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('FeaturesList', () => {
|
||||
id: 'legacy',
|
||||
};
|
||||
const features = [
|
||||
{ id: 'lti' },
|
||||
{ id: 'lti-basic-configuration' },
|
||||
{ id: 'wcag-2.1' },
|
||||
{ id: 'discussion-page' },
|
||||
{ id: 'embedded-course-sections' },
|
||||
|
||||
@@ -19,13 +19,13 @@ describe('FeaturesTable', () => {
|
||||
},
|
||||
{
|
||||
externalLinks: {},
|
||||
featureIds: ['discussion-page', 'lti'],
|
||||
featureIds: ['discussion-page', 'lti-basic-configuration'],
|
||||
hasFullSupport: false,
|
||||
id: 'piazza',
|
||||
}];
|
||||
|
||||
features = [
|
||||
{ id: 'lti' },
|
||||
{ id: 'lti-basic-configuration' },
|
||||
{ id: 'wcag-2.1' },
|
||||
{ id: 'discussion-page' },
|
||||
{ id: 'embedded-course-sections' },
|
||||
|
||||
@@ -34,9 +34,9 @@ const messages = defineMessages({
|
||||
defaultMessage: 'Full support',
|
||||
description: 'A label indicating that an app supports the full set of possible features for a discussions app.',
|
||||
},
|
||||
appPartialSupport: {
|
||||
id: 'authoring.discussions.appPartialSupport',
|
||||
defaultMessage: 'Partial support',
|
||||
appBasicSupport: {
|
||||
id: 'authoring.discussions.appBasicSupport',
|
||||
defaultMessage: 'Basic support',
|
||||
description: 'A label indicating that an app only supports a subset of the possible features of a discussions app.',
|
||||
},
|
||||
selectApp: {
|
||||
@@ -124,11 +124,6 @@ const messages = defineMessages({
|
||||
defaultMessage: 'Embedded course sections',
|
||||
description: 'The name of a discussions feature.',
|
||||
},
|
||||
'featureName-lti': {
|
||||
id: 'authoring.discussions.featureName-lti',
|
||||
defaultMessage: 'LTI integration',
|
||||
description: 'The name of a discussions feature.',
|
||||
},
|
||||
'featureName-advanced-in-context-discussion': {
|
||||
id: 'authoring.discussions.featureName-advanced-in-context-discussion',
|
||||
defaultMessage: 'Advanced in context discussion',
|
||||
|
||||
@@ -61,7 +61,7 @@ function normalizeApps(data) {
|
||||
accessibility: app.external_links.accessibility,
|
||||
contactEmail: app.external_links.contact_email,
|
||||
},
|
||||
hasFullSupport: app.features.length >= data.features.length,
|
||||
hasFullSupport: app.has_full_support,
|
||||
}));
|
||||
return {
|
||||
courseId: data.context_key,
|
||||
|
||||
@@ -24,8 +24,8 @@ const featuresState = {
|
||||
'wcag-2.1': {
|
||||
id: 'wcag-2.1',
|
||||
},
|
||||
lti: {
|
||||
id: 'lti',
|
||||
'lti-basic-configuration': {
|
||||
id: 'lti-basic-configuration',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ const featureIds = [
|
||||
'discussion-page',
|
||||
'embedded-course-sections',
|
||||
'wcag-2.1',
|
||||
'lti',
|
||||
'lti-basic-configuration',
|
||||
];
|
||||
|
||||
const legacyApp = {
|
||||
@@ -50,7 +50,7 @@ const legacyApp = {
|
||||
accessibility: '',
|
||||
contactEmail: '',
|
||||
},
|
||||
hasFullSupport: false,
|
||||
hasFullSupport: true,
|
||||
messages: [],
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ const piazzaApp = {
|
||||
'discussion-page',
|
||||
'embedded-course-sections',
|
||||
'wcag-2.1',
|
||||
'lti',
|
||||
'lti-basic-configuration',
|
||||
],
|
||||
externalLinks: {
|
||||
learnMore: '',
|
||||
@@ -69,7 +69,7 @@ const piazzaApp = {
|
||||
accessibility: '',
|
||||
contactEmail: '',
|
||||
},
|
||||
hasFullSupport: true,
|
||||
hasFullSupport: false,
|
||||
messages: [],
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export const piazzaApiResponse = {
|
||||
'discussion-page',
|
||||
'embedded-course-sections',
|
||||
'wcag-2.1',
|
||||
'lti',
|
||||
'lti-basic-configuration',
|
||||
],
|
||||
lti_configuration: {
|
||||
lti_1p1_client_key: 'client_key_123',
|
||||
@@ -32,6 +32,7 @@ export const piazzaApiResponse = {
|
||||
contact_email: '',
|
||||
},
|
||||
messages: [],
|
||||
has_full_support: true,
|
||||
},
|
||||
piazza: {
|
||||
features: [
|
||||
@@ -39,7 +40,7 @@ export const piazzaApiResponse = {
|
||||
'discussion-page',
|
||||
'embedded-course-sections',
|
||||
'wcag-2.1',
|
||||
'lti',
|
||||
'lti-basic-configuration',
|
||||
],
|
||||
external_links: {
|
||||
learn_more: '',
|
||||
@@ -49,6 +50,7 @@ export const piazzaApiResponse = {
|
||||
contact_email: '',
|
||||
},
|
||||
messages: [],
|
||||
has_full_support: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -62,7 +64,7 @@ export const legacyApiResponse = {
|
||||
'discussion-page',
|
||||
'embedded-course-sections',
|
||||
'wcag-2.1',
|
||||
'lti',
|
||||
'lti-basic-configuration',
|
||||
],
|
||||
lti_configuration: {},
|
||||
plugin_configuration: {
|
||||
@@ -101,6 +103,7 @@ export const legacyApiResponse = {
|
||||
contact_email: '',
|
||||
},
|
||||
messages: [],
|
||||
has_full_support: true,
|
||||
},
|
||||
piazza: {
|
||||
features: [
|
||||
@@ -108,7 +111,7 @@ export const legacyApiResponse = {
|
||||
'discussion-page',
|
||||
'embedded-course-sections',
|
||||
'wcag-2.1',
|
||||
'lti',
|
||||
'lti-basic-configuration',
|
||||
],
|
||||
external_links: {
|
||||
learn_more: '',
|
||||
@@ -118,6 +121,7 @@ export const legacyApiResponse = {
|
||||
contact_email: '',
|
||||
},
|
||||
messages: [],
|
||||
has_full_support: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -133,7 +137,6 @@ export const emptyAppApiResponse = {
|
||||
providers: {
|
||||
active: 'legacy',
|
||||
available: {
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user