Skip to content

Commit bc484fa

Browse files
authored
Merge pull request #5820 from marcellamaki/add-community-channel-criteria
Add details to submit panel about acceptance criteria
2 parents 381380b + 3ffe139 commit bc484fa

3 files changed

Lines changed: 203 additions & 10 deletions

File tree

contentcuration/contentcuration/frontend/channelEdit/components/sidePanels/SubmitToCommunityLibrarySidePanel/__tests__/SubmitToCommunityLibrarySidePanel.spec.js

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ jest.mock('shared/data/resources', () => ({
3030

3131
const store = factory();
3232

33-
const { nonePrimaryInfo$, flaggedPrimaryInfo$, approvedPrimaryInfo$, submittedPrimaryInfo$ } =
34-
communityChannelsStrings;
33+
const {
34+
nonePrimaryInfo$,
35+
flaggedPrimaryInfo$,
36+
approvedPrimaryInfo$,
37+
submittedPrimaryInfo$,
38+
moreDetails$,
39+
countriesInfoText$,
40+
} = communityChannelsStrings;
3541

3642
async function makeWrapper({ channel, publishedData, latestSubmission }) {
3743
const isLoading = ref(true);
@@ -246,26 +252,54 @@ describe('SubmitToCommunityLibrarySidePanel', () => {
246252
expect(moreDetailsButton.exists()).toBe(false);
247253
});
248254

249-
it('when clicked, shows additional info', async () => {
255+
it('when clicked, shows additional info and a hide button', async () => {
250256
const wrapper = await makeWrapper({
251257
channel: publishedNonPublicChannel,
252258
publishedData,
253259
latestSubmission: null,
254260
});
255261

256-
const infoText = wrapper.find('.info-text');
257-
expect(infoText.text()).not.toContain('The Kolibri Community Library features channels');
258-
259262
const moreDetailsButton = wrapper.find('[data-test="more-details-button"]');
263+
expect(wrapper.text()).not.toContain(moreDetails$());
260264
await moreDetailsButton.trigger('click');
261265

262-
expect(infoText.text()).toContain('The Kolibri Community Library features channels');
266+
expect(wrapper.text()).toContain(moreDetails$());
263267

264268
const lessDetailsButton = wrapper.find('[data-test="less-details-button"]');
265269
expect(lessDetailsButton.exists()).toBe(true);
266270
});
267271
});
268272

273+
describe('show more country info button', () => {
274+
it('is always displayed', async () => {
275+
const wrapper = await makeWrapper({
276+
channel: publishedNonPublicChannel,
277+
publishedData,
278+
latestSubmission: { channel_version: 1, status: CommunityLibraryStatus.APPROVED },
279+
});
280+
281+
const moreCountryInfoButton = wrapper.find('[data-test="more-country-info-button"]');
282+
expect(moreCountryInfoButton.exists()).toBe(true);
283+
});
284+
285+
it('when clicked, shows country info and a hide button', async () => {
286+
const wrapper = await makeWrapper({
287+
channel: publishedNonPublicChannel,
288+
publishedData,
289+
latestSubmission: null,
290+
});
291+
292+
const moreCountryInfoButton = wrapper.find('[data-test="more-country-info-button"]');
293+
expect(wrapper.text()).not.toContain(countriesInfoText$());
294+
await moreCountryInfoButton.trigger('click');
295+
296+
expect(wrapper.text()).toContain(countriesInfoText$());
297+
298+
const lessCountryInfoButton = wrapper.find('[data-test="less-country-info-button"]');
299+
expect(lessCountryInfoButton.exists()).toBe(true);
300+
});
301+
});
302+
269303
describe('publishing state', () => {
270304
beforeEach(() => {
271305
jest.useFakeTimers();

contentcuration/contentcuration/frontend/channelEdit/components/sidePanels/SubmitToCommunityLibrarySidePanel/index.vue

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,43 @@
152152
:channel-version-id="channelVersionId"
153153
@update:allChecked="allSpecialPermissionsChecked = $event"
154154
/>
155+
<hr >
156+
<div class="info-text">
157+
<p class="checklist-intro">
158+
{{ channelFitChecklistIntro$() }}
159+
</p>
160+
<ul
161+
v-if="showingCriteria"
162+
class="checklist"
163+
>
164+
<li>
165+
<strong>{{ channelFitLicenseLabel$() }}:</strong>
166+
{{ channelFitChecklistLicense$() }}
167+
</li>
168+
<li>
169+
<strong>{{ channelFitOfflineUseLabel$() }}:</strong>
170+
{{ channelFitChecklistOfflineUse$() }}
171+
</li>
172+
<li>
173+
<strong>{{ channelFitAttributionLabel$() }}:</strong>
174+
{{ channelFitChecklistAttribution$() }}
175+
</li>
176+
<li>
177+
<strong>{{ channelFitQualityLabel$() }}:</strong>
178+
{{ channelFitChecklistQuality$() }}
179+
</li>
180+
<li>
181+
<strong>{{ channelFitChannelInfoLabel$() }}:</strong>
182+
{{ channelFitChecklistChannelInfo$() }}
183+
</li>
184+
</ul>
185+
<KButton
186+
appearance="basic-link"
187+
@click="showingCriteria = !showingCriteria"
188+
>
189+
{{ showingCriteria ? hideCriteriaAction$() : viewCriteriaAction$() }}
190+
</KButton>
191+
</div>
155192
<div class="country-area">
156193
<KTransition kind="component-fade-out-in">
157194
<div
@@ -171,6 +208,25 @@
171208
/>
172209
</KTransition>
173210
</div>
211+
<div v-if="showingCountriesInfo">
212+
<div class="info-text">{{ countriesInfoText$() }}</div>
213+
<KButton
214+
appearance="basic-link"
215+
data-test="less-country-info-button"
216+
@click="showingCountriesInfo = false"
217+
>
218+
{{ lessDetailsButton$() }}
219+
</KButton>
220+
</div>
221+
<div v-else>
222+
<KButton
223+
appearance="basic-link"
224+
data-test="more-country-info-button"
225+
@click="showingCountriesInfo = true"
226+
>
227+
{{ moreDetailsButton$() }}
228+
</KButton>
229+
</div>
174230
<KTextbox
175231
v-model="description"
176232
:disabled="!canBeEdited"
@@ -275,6 +331,7 @@
275331
moreDetailsButton$,
276332
lessDetailsButton$,
277333
countryLabel$,
334+
countriesInfoText$,
278335
descriptionLabel$,
279336
descriptionRequired$,
280337
notPublishedWarningTitle$,
@@ -295,12 +352,27 @@
295352
submittingSnackbar$,
296353
publishingMessage$,
297354
confirmReplacementText$,
355+
channelFitChecklistIntro$,
356+
channelFitLicenseLabel$,
357+
channelFitChecklistLicense$,
358+
channelFitOfflineUseLabel$,
359+
channelFitChecklistOfflineUse$,
360+
channelFitAttributionLabel$,
361+
channelFitChecklistAttribution$,
362+
channelFitQualityLabel$,
363+
channelFitChecklistQuality$,
364+
channelFitChannelInfoLabel$,
365+
channelFitChecklistChannelInfo$,
366+
viewCriteriaAction$,
367+
hideCriteriaAction$,
298368
} = communityChannelsStrings;
299369
300370
const annotationColor = computed(() => tokensTheme.annotation);
301371
const infoTextColor = computed(() => paletteTheme.grey.v_700);
302372
303373
const showingMoreDetails = ref(false);
374+
const showingCriteria = ref(false);
375+
const showingCountriesInfo = ref(false);
304376
const countries = ref([]);
305377
const description = ref('');
306378
const isPublishing = computed(() => props.channel?.publishing === true);
@@ -542,6 +614,8 @@
542614
annotationColor,
543615
infoTextColor,
544616
showingMoreDetails,
617+
showingCriteria,
618+
showingCountriesInfo,
545619
countries,
546620
description,
547621
replacementConfirmed,
@@ -571,6 +645,7 @@
571645
moreDetailsButton$,
572646
lessDetailsButton$,
573647
countryLabel$,
648+
countriesInfoText$,
574649
descriptionLabel$,
575650
descriptionRequired$,
576651
channelVersion$,
@@ -587,6 +662,19 @@
587662
confirmReplacementText$,
588663
checkedSpecialPermissions,
589664
allSpecialPermissionsChecked,
665+
channelFitChecklistIntro$,
666+
channelFitLicenseLabel$,
667+
channelFitChecklistLicense$,
668+
channelFitOfflineUseLabel$,
669+
channelFitChecklistOfflineUse$,
670+
channelFitAttributionLabel$,
671+
channelFitChecklistAttribution$,
672+
channelFitQualityLabel$,
673+
channelFitChecklistQuality$,
674+
channelFitChannelInfoLabel$,
675+
channelFitChecklistChannelInfo$,
676+
viewCriteriaAction$,
677+
hideCriteriaAction$,
590678
};
591679
},
592680
props: {
@@ -628,6 +716,14 @@
628716
color: v-bind('annotationColor');
629717
}
630718
719+
.checklist {
720+
padding-bottom: 12px;
721+
}
722+
723+
.checklist-intro {
724+
font-weight: 600;
725+
}
726+
631727
.content {
632728
display: flex;
633729
flex-direction: column;

contentcuration/contentcuration/frontend/shared/strings/communityChannelsStrings.js

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ export const communityChannelsStrings = createTranslator('CommunityChannelsStrin
164164
'Information shown in the "Submit to Community Library" panel when a previous version was flagged',
165165
},
166166
nonePrimaryInfo: {
167-
message: 'Your published channel will be added to the Community Library review queue.',
167+
message:
168+
"We're inviting members of the Kolibri community to submit channels they've created for offline learning in low-resource settings. ",
168169
context:
169170
'Information shown in the "Submit to Community Library" panel when there are no previous submissions',
170171
},
@@ -180,10 +181,15 @@ export const communityChannelsStrings = createTranslator('CommunityChannelsStrin
180181
},
181182
moreDetails: {
182183
message:
183-
"The Kolibri Community Library features channels created by the community. Share your openly licensed work for review, and once it's approved, it will be available to users in your selected region or language.",
184+
"After your submission is approved, the channel will be available to other Kolibri Studio users on the 'Community Library' page.",
184185
context:
185186
'Detailed description of the Community Library shown in the "Submit to Community Library" panel',
186187
},
188+
countriesInfoText: {
189+
message:
190+
'Select one or more countries to tag your channels submission with. For example, if your channel contains materials aligned to a national curriculum or regionally-specific content, selecting the relevant countries will help users find it. Otherwise, leave this blank.',
191+
context: 'Help text for the country selection field in the "Submit to Community Library" panel',
192+
},
187193
notPublishedWarningTitle: {
188194
message: "This channel isn't published to Kolibri Studio yet",
189195
context:
@@ -216,7 +222,7 @@ export const communityChannelsStrings = createTranslator('CommunityChannelsStrin
216222
'Description of warning shown in the "Submit to Community Library" panel when the current version is already submitted',
217223
},
218224
descriptionLabel: {
219-
message: "Describe what's new in this submission",
225+
message: "Describe what's included in this submission",
220226
context:
221227
'Label for the submission description field in the "Submit to Community Library" panel',
222228
},
@@ -273,6 +279,63 @@ export const communityChannelsStrings = createTranslator('CommunityChannelsStrin
273279
context:
274280
'Label for the notes that admins can add to a submission in the Community Library for themselves',
275281
},
282+
channelFitLicenseLabel: {
283+
message: 'License',
284+
context: 'Label for the license checklist item in the channel fit checklist',
285+
},
286+
channelFitOfflineUseLabel: {
287+
message: 'Offline use',
288+
context: 'Label for the offline use checklist item in the channel fit checklist',
289+
},
290+
channelFitAttributionLabel: {
291+
message: 'Attribution',
292+
context: 'Label for the attribution checklist item in the channel fit checklist',
293+
},
294+
channelFitQualityLabel: {
295+
message: 'Quality',
296+
context: 'Label for the quality checklist item in the channel fit checklist',
297+
},
298+
channelFitChannelInfoLabel: {
299+
message: 'Channel information',
300+
context: 'Label for the channel information checklist item in the channel fit checklist',
301+
},
302+
channelFitChecklistIntro: {
303+
message: 'Is your channel a good fit?',
304+
context:
305+
'Introductory text before a checklist of criteria for submitting a channel to the Community Library',
306+
},
307+
viewCriteriaAction: {
308+
message: 'View criteria',
309+
context: 'Button text to view the channel fit checklist criteria',
310+
},
311+
hideCriteriaAction: {
312+
message: 'Hide criteria',
313+
context: 'Button text to hide the channel fit checklist criteria',
314+
},
315+
channelFitChecklistLicense: {
316+
message: 'Is your content openly licensed or in the public domain?',
317+
context:
318+
'License checklist item asking whether the channel content uses open or public domain licenses',
319+
},
320+
channelFitChecklistOfflineUse: {
321+
message: 'Does your channel work without an internet connection?',
322+
context: 'Offline use checklist item asking whether the channel works offline',
323+
},
324+
channelFitChecklistAttribution: {
325+
message: 'Does each piece of content have an author listed?',
326+
context: 'Attribution checklist item asking whether content items have authors listed',
327+
},
328+
channelFitChecklistQuality: {
329+
message:
330+
'Has anyone on your team or in your organization reviewed it and found it useful for learners?',
331+
context:
332+
'Quality checklist item asking whether the channel has been reviewed and validated by someone on the team',
333+
},
334+
channelFitChecklistChannelInfo: {
335+
message:
336+
"Is your channel's basic information filled in — title, description, thumbnail, language, subject, and level?",
337+
context: 'Channel information checklist item asking whether the channel metadata is complete',
338+
},
276339
confirmReplacementText: {
277340
message: 'I understand this will replace my earlier submission on the review queue',
278341
context: 'Checkbox text shown when there is a pending submission to confirm replacement',

0 commit comments

Comments
 (0)