Skip to content

Commit

Permalink
fix: Update discussion provider featues
Browse files Browse the repository at this point in the history
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
  • Loading branch information
awaisdar001 committed Jul 30, 2021
1 parent 28107fc commit 6b7f77f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 28 deletions.
3 changes: 1 addition & 2 deletions src/pages-and-resources/discussions/app-list/AppCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions src/pages-and-resources/discussions/app-list/AppCard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
11 changes: 3 additions & 8 deletions src/pages-and-resources/discussions/app-list/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/pages-and-resources/discussions/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/pages-and-resources/discussions/data/redux.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ const featuresState = {
'wcag-2.1': {
id: 'wcag-2.1',
},
lti: {
id: 'lti',
'lti-basic-configuration': {
id: 'lti-basic-configuration',
},
};

const featureIds = [
'discussion-page',
'embedded-course-sections',
'wcag-2.1',
'lti',
'lti-basic-configuration',
];

const legacyApp = {
Expand All @@ -50,7 +50,7 @@ const legacyApp = {
accessibility: '',
contactEmail: '',
},
hasFullSupport: false,
hasFullSupport: true,
messages: [],
};

Expand All @@ -60,7 +60,7 @@ const piazzaApp = {
'discussion-page',
'embedded-course-sections',
'wcag-2.1',
'lti',
'lti-basic-configuration',
],
externalLinks: {
learnMore: '',
Expand All @@ -69,7 +69,7 @@ const piazzaApp = {
accessibility: '',
contactEmail: '',
},
hasFullSupport: true,
hasFullSupport: false,
messages: [],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -32,14 +32,15 @@ export const piazzaApiResponse = {
contact_email: '',
},
messages: [],
has_full_support: true,
},
piazza: {
features: [
// We give piazza all features just so we can test our "full support" text.
'discussion-page',
'embedded-course-sections',
'wcag-2.1',
'lti',
'lti-basic-configuration',
],
external_links: {
learn_more: '',
Expand All @@ -49,6 +50,7 @@ export const piazzaApiResponse = {
contact_email: '',
},
messages: [],
has_full_support: false,
},
},
},
Expand All @@ -62,7 +64,7 @@ export const legacyApiResponse = {
'discussion-page',
'embedded-course-sections',
'wcag-2.1',
'lti',
'lti-basic-configuration',
],
lti_configuration: {},
plugin_configuration: {
Expand Down Expand Up @@ -101,14 +103,15 @@ export const legacyApiResponse = {
contact_email: '',
},
messages: [],
has_full_support: true,
},
piazza: {
features: [
// We give piazza all features just so we can test our "full support" text.
'discussion-page',
'embedded-course-sections',
'wcag-2.1',
'lti',
'lti-basic-configuration',
],
external_links: {
learn_more: '',
Expand All @@ -118,6 +121,7 @@ export const legacyApiResponse = {
contact_email: '',
},
messages: [],
has_full_support: false,
},
},
},
Expand All @@ -133,7 +137,6 @@ export const emptyAppApiResponse = {
providers: {
active: 'legacy',
available: {

},
},
};

0 comments on commit 6b7f77f

Please sign in to comment.