Skip to content

Commit

Permalink
Merge pull request #5349 from rtibbles/0.12intodevelop
Browse files Browse the repository at this point in the history
0.12 into develop
  • Loading branch information
rtibbles committed Apr 6, 2019
2 parents 641af11 + 5530cf9 commit ac12a46
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 38 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@ Release Notes

List of the most important changes for each release.

0.12.2
------

Added
~~~~~

- Dynamic selection for CherryPy thread count based on available server memory


Changed or fixed
~~~~~~~~~~~~~~~~

- Alignment of coach report icons when viewed in right-to-left languages corrected
- Fixes to loading of some HTML5 apps
- Lessons are now correctly scoped to their classes for learners


Internationalization and localization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Added Gujarati
- Fixed missing translations in coach group management

See a `full list <https://github.com/learningequality/kolibri/issues?q=label%3Achangelog+milestone%3A0.12.2>`__ of changes on Github


0.12.1
------

Expand Down
2 changes: 1 addition & 1 deletion kolibri/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#: This may not be the exact version as it's subject to modification with
#: get_version() - use ``kolibri.__version__`` for the exact version string.
VERSION = (0, 12, 2, "beta", 0)
VERSION = (0, 12, 3, "beta", 0)

__author__ = "Learning Equality"
__email__ = "info@learningequality.org"
Expand Down
4 changes: 2 additions & 2 deletions kolibri/locale/es_ES/LC_MESSAGES/coach_module-messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@
"LessonsSearchFilters.topics": "Temas",
"LessonsSearchFilters.videos": "Vídeos",
"ManageExamModals.assignmentQuestion": "Asignar prueba a",
"ManageExamModals.changeExamStatusActive": "Activo",
"ManageExamModals.changeExamStatusActive": "Activa",
"ManageExamModals.changeExamStatusDescription": "Estudiantes solo pueden ver pruebas activas",
"ManageExamModals.changeExamStatusInactive": "Inactivo",
"ManageExamModals.changeExamStatusInactive": "Inactiva",
"ManageExamModals.changeExamStatusTitle": "Cambiar estado de la prueba",
"ManageExamModals.copyExamTitle": "Copiar prueba a",
"ManageExamModals.copyOfExam": "Copia de { examTitle }",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { MembershipResource, RoleResource } from 'kolibri.resources';
import { UserKinds } from 'kolibri.coreVue.vuex.constants';
import uniq from 'lodash/uniq';

export function enrollLearnersInClass(store, { classId, users }) {
return MembershipResource.saveCollection({
getParams: {
collection: classId,
},
data: users.map(userId => ({
data: uniq(users).map(userId => ({
collection: classId,
user: userId,
})),
Expand All @@ -20,7 +21,7 @@ export function assignCoachesToClass(store, { classId, coaches }) {
getParams: {
collection: classId,
},
data: coaches.map(userId => ({
data: uniq(coaches).map(userId => ({
collection: classId,
user: userId,
kind: UserKinds.COACH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function showClassEditPage(store, classId) {
const facilityId = store.getters.currentFacilityId;
const promises = [
FacilityUserResource.fetchCollection({ getParams: { member_of: classId }, force: true }),
ClassroomResource.fetchModel({ id: classId }),
ClassroomResource.fetchModel({ id: classId, force: true }),
ClassroomResource.fetchCollection({ getParams: { parent: facilityId }, force: true }),
];

Expand Down
4 changes: 3 additions & 1 deletion packages/hashi/src/loadCurrentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export function setContent(contents) {
const runList = $nonDeferredScripts.concat($deferredScripts).map(function($script) {
return function(callback) {
const cb = () => {
delete window.onerror;
try {
delete window.onerror;
} catch (e) {} // eslint-disable-line no-empty
callback();
};
window.onerror = cb;
Expand Down
66 changes: 35 additions & 31 deletions packages/hashi/src/replaceScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,49 +23,53 @@ export const runScriptTypes = [
];

export default function replaceScript($script, callback) {
const s = document.createElement('script');
s.type = 'text/javascript';
[].forEach.call($script.attributes, attribute => {
// Set src later when everything else
// has been set.
if (attribute.name !== 'src') {
s.setAttribute(attribute.name, attribute.value);
}
});
if ($script.src) {
if (!$script.async) {
if (!$script.loaded) {
$script.loaded = true;
const s = document.createElement('script');
s.type = 'text/javascript';
[].forEach.call($script.attributes, attribute => {
// Set src later when everything else
// has been set.
if (attribute.name !== 'src') {
s.setAttribute(attribute.name, attribute.value);
}
});
if ($script.src) {
const cb = () => {
// Clean up onload and onerror handlers
// after they have been triggered to avoid
// these being called again.
delete s.onload;
delete s.onerror;
try {
delete s.onload;
delete s.onerror;
} catch (e) {} // eslint-disable-line no-empty
callback();
};
s.onload = cb;
s.onerror = cb;
s.src = $script.src;
s.async = false;
} else {
s.innerHTML = $script.innerHTML;
}
s.src = $script.src;
} else {
s.innerHTML = $script.innerHTML;
}

const parentNode = $script.parentNode;
const parentNode = $script.parentNode;

const typeAttr = $script.getAttribute('type');
const typeAttr = $script.getAttribute('type');

// only run script tags without the type attribute
// or with a javascript mime attribute value
if (!typeAttr || runScriptTypes.indexOf(typeAttr) !== -1) {
// Remove the element so that we don't clutter the DOM
// with duplicates.
parentNode.removeChild($script);
// re-insert the script tag so it executes.
parentNode.appendChild(s);
}
// only run script tags without the type attribute
// or with a javascript mime attribute value
if (!typeAttr || runScriptTypes.indexOf(typeAttr) !== -1) {
// Remove the element so that we don't clutter the DOM
// with duplicates.
parentNode.removeChild($script);
// re-insert the script tag so it executes.
parentNode.appendChild(s);
}

// run the callback immediately for inline scripts
if (!$script.src || $script.async) {
callback();
// run the callback immediately for inline scripts
if (!$script.src) {
callback();
}
}
}

0 comments on commit ac12a46

Please sign in to comment.