Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ i18n-extract: i18n-extract-frontend i18n-extract-backend
i18n-transfer-context:
yarn transfercontext

#i18n-django-compilemessages:
# Change working directory to kolibri/ such that compilemessages
i18n-django-compilemessages:
# Change working directory to contentcuration/ such that compilemessages
# finds only the .po files nested there.
#cd kolibri && PYTHONPATH="..:$$PYTHONPATH" python -m kolibri manage compilemessages
cd contentcuration && python manage.py compilemessages

i18n-upload: i18n-extract
python node_modules/kolibri-tools/lib/i18n/crowdin.py upload-sources ${branch}
Expand All @@ -91,27 +91,15 @@ i18n-pretranslate:
i18n-pretranslate-approve-all:
python node_modules/kolibri-tools/lib/i18n/crowdin.py pretranslate ${branch} --approve-all

i18n-convert:
python node_modules/kolibri-tools/lib/i18n/crowdin.py convert-files

i18n-download-translations:
python node_modules/kolibri-tools/lib/i18n/crowdin.py rebuild-translations ${branch}
python node_modules/kolibri-tools/lib/i18n/crowdin.py download-translations ${branch}
node node_modules/kolibri-tools/lib/i18n/intl_code_gen.js
python node_modules/kolibri-tools/lib/i18n/crowdin.py convert-files
# TODO: is this necessary? # Manual hack to add es language by copying es_ES to es
# cp -r contentcuration/locale/es_ES contentcuration/locale/es
yarn exec kolibri-tools i18n-code-gen -- --output-dir ./contentcuration/contentcuration/frontend/shared/i18n
$(MAKE) i18n-django-compilemessages
yarn exec kolibri-tools i18n-create-message-files -- --namespace contentcuration --searchPath ./contentcuration/contentcuration/frontend

i18n-download: i18n-download-translations

i18n-update:
echo "WARNING: i18n-update has been renamed to i18n-download"
$(MAKE) i18n-download
echo "WARNING: i18n-update has been renamed to i18n-download"

i18n-stats:
python node_modules/kolibri-tools/lib/i18n/crowdin.py translation-stats ${branch}

i18n-download-glossary:
python node_modules/kolibri-tools/lib/i18n/crowdin.py download-glossary

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
},
clean() {
return data => {
let cleanedData = { ...data, policies: {} };
const cleanedData = { ...data, policies: {} };
Object.keys(cleanedData).forEach(key => {
// Trim text fields
if (key === 'source') {
Expand Down Expand Up @@ -425,7 +425,7 @@
},
submit() {
if (this.$refs.form.validate()) {
let cleanedData = this.clean(this.form);
const cleanedData = this.clean(this.form);
return this.register(cleanedData)
.then(() => {
this.$router.push({ name: 'ActivationSent' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
submit() {
if (this.$refs.form.validate()) {
this.busy = true;
let credentials = {
const credentials = {
username: this.username,
password: this.password,
};
Expand Down Expand Up @@ -211,6 +211,7 @@

.main {
overflow: auto;
/* stylelint-disable-next-line custom-property-pattern */
background-color: var(--v-backgroundColor-base);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const defaultData = {
const register = jest.fn();

function makeWrapper(formData) {
let wrapper = mount(Create, {
const wrapper = mount(Create, {
router,
computed: {
getPolicyAcceptedData() {
Expand Down Expand Up @@ -80,13 +80,13 @@ describe('create', () => {
});
it('should trigger submit method when form is submitted', () => {
const submit = jest.fn();
let wrapper = makeWrapper();
const wrapper = makeWrapper();
wrapper.setMethods({ submit });
wrapper.find({ ref: 'form' }).trigger('submit');
expect(submit).toHaveBeenCalled();
});
it('should call register with form data', () => {
let wrapper = makeWrapper();
const wrapper = makeWrapper();
wrapper.find({ ref: 'form' }).trigger('submit');
expect(register.mock.calls[0][0]).toEqual({
...defaultData,
Expand All @@ -97,12 +97,12 @@ describe('create', () => {
});
it('should automatically fill the email if provided in the query param', () => {
router.push({ name: 'Create', query: { email: 'newtest@test.com' } });
let wrapper = mount(Create, { router, stubs: ['PolicyModals'], mocks: connectionStateMocks });
const wrapper = mount(Create, { router, stubs: ['PolicyModals'], mocks: connectionStateMocks });
expect(wrapper.vm.form.email).toBe('newtest@test.com');
});
describe('validation', () => {
it('should call register if form is valid', () => {
let wrapper = makeWrapper();
const wrapper = makeWrapper();
wrapper.vm.submit();
expect(register).toHaveBeenCalled();
});
Expand All @@ -121,26 +121,26 @@ describe('create', () => {
};

Object.keys(form).forEach(field => {
let wrapper = makeWrapper({ [field]: form[field] });
const wrapper = makeWrapper({ [field]: form[field] });
wrapper.vm.submit();
expect(register).not.toHaveBeenCalled();
});
});
it('should fail if password1 and password2 do not match', () => {
let wrapper = makeWrapper({ password1: 'some other password' });
const wrapper = makeWrapper({ password1: 'some other password' });
wrapper.vm.submit();
expect(register).not.toHaveBeenCalled();
});
it('should fail if uses field is set to fields that require more input that is not provided', () => {
[uses.STORING, uses.OTHER].forEach(use => {
let wrapper = makeWrapper({ uses: [use] });
const wrapper = makeWrapper({ uses: [use] });
wrapper.vm.submit();
expect(register).not.toHaveBeenCalled();
});
});
it('should fail if source field is set to an option that requires more input that is not provided', () => {
[sources.ORGANIZATION, sources.CONFERENCE, sources.OTHER].forEach(source => {
let wrapper = makeWrapper({ source });
const wrapper = makeWrapper({ source });
wrapper.vm.submit();
expect(register).not.toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Main from '../Main';
const login = jest.fn();

function makeWrapper() {
let wrapper = mount(Main, {
const wrapper = mount(Main, {
router,
stubs: ['GlobalSnackbar', 'PolicyModals'],
mocks: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
submit() {
this.error = false;
if (this.$refs.form.validate()) {
let payload = {
const payload = {
...this.$route.query,
new_password1: this.new_password1,
new_password2: this.new_password2,
Expand Down Expand Up @@ -94,4 +94,4 @@
width: 100%;
}

</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
return client.post(window.Urls.auth_password_reset(), { email });
},
setPassword(context, { uidb64, token, new_password1, new_password2 }) {
let data = {
const data = {
new_password1,
new_password2,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function generateFilterMixin(filterMap) {
return this.$route.query.keywords;
},
set(value) {
let params = { ...this.$route.query, page: 1 };
const params = { ...this.$route.query, page: 1 };
if (value) {
params.keywords = value;
} else {
Expand All @@ -37,7 +37,7 @@ export function generateFilterMixin(filterMap) {
get() {
// Return filter where all param conditions are met
const filterKeys = intersection(Object.keys(this.$route.query), paramKeys);
let key = findKey(filterMap, value => {
const key = findKey(filterMap, value => {
return filterKeys.every(field => {
return value.params[field] === _getBooleanVal(this.$route.query[field]);
});
Expand Down Expand Up @@ -115,7 +115,7 @@ export const tableMixin = {
computed: {
pagination: {
get() {
let params = {
const params = {
rowsPerPage: Number(this.$route.query.page_size) || 25,
page: Number(this.$route.query.page) || 1,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@

.v-icon:not(.v-icon--is-component) {
font-size: 16pt !important;
/* stylelint-disable-next-line custom-property-pattern */
color: var(--v-darkGrey-darken1) !important;
opacity: 1 !important;
transform: none !important;
Expand Down Expand Up @@ -159,6 +160,7 @@
}

tr:hover td {
/* stylelint-disable-next-line custom-property-pattern */
background-color: var(--v-greyBackground-base) !important;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@
import ClipboardChip from '../../components/ClipboardChip';
import { RouteNames } from '../../constants';
import ChannelActionsDropdown from './ChannelActionsDropdown';
import Checkbox from 'shared/views/form/Checkbox';
import { fileSizeMixin } from 'shared/mixins';
import Checkbox from 'shared/views/form/Checkbox';

export default {
name: 'ChannelItem',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
<script>

import { mapGetters, mapActions } from 'vuex';
import { tableMixin, generateFilterMixin } from '../../mixins';
import { RouteNames, rowsPerPageItems } from '../../constants';
import { tableMixin, generateFilterMixin } from '../../mixins';
import ChannelItem from './ChannelItem';
import { channelExportMixin } from 'shared/views/channel/mixins';
import { routerMixin } from 'shared/mixins';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
import capitalize from 'lodash/capitalize';
import { mapActions, mapGetters } from 'vuex';
import { RouteNames } from '../../constants';
import UserActionsDropdown from './UserActionsDropdown';
import UserStorage from './UserStorage';
import UserActionsDropdown from './UserActionsDropdown';
import { routerMixin, fileSizeMixin } from 'shared/mixins';
import LoadingText from 'shared/views/LoadingText';
import FullscreenModal from 'shared/views/FullscreenModal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
import { RouteNames } from '../../constants';
import UserActionsDropdown from './UserActionsDropdown';
import UserStorage from './UserStorage';
import Checkbox from 'shared/views/form/Checkbox';
import { fileSizeMixin } from 'shared/mixins';
import Checkbox from 'shared/views/form/Checkbox';

export default {
name: 'UserItem',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@

import { mapState, mapGetters, mapActions } from 'vuex';

import ResourceDrawer from './ResourceDrawer';
import NodeTreeNavigation from './NodeTreeNavigation';
import ResourceDrawer from './ResourceDrawer';
import ContentNodeIcon from 'shared/views/ContentNodeIcon';
import FullscreenModal from 'shared/views/FullscreenModal';
import { titleMixin } from 'shared/mixins';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('AnswersEditor', () => {
const inputs = wrapper.findAll('input');

expect(inputs.length).toBe(2);
for (let n in [0, 1]) {
for (const n in [0, 1]) {
expect(inputs.at(n).attributes()['type']).toBe('radio');
}
});
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('AnswersEditor', () => {
const inputs = wrapper.findAll('input');

expect(inputs.length).toBe(3);
for (let n in [0, 1, 2]) {
for (const n in [0, 1, 2]) {
expect(inputs.at(n).attributes()['type']).toBe('checkbox');
}
});
Expand Down Expand Up @@ -185,7 +185,7 @@ describe('AnswersEditor', () => {
const inputs = wrapper.findAll('input');

expect(inputs.length).toBe(2);
for (let n in [0, 1]) {
for (const n in [0, 1]) {
expect(inputs.at(n).attributes()['type']).toBe('radio');
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
@exercise-answer-wrong: #ef5350;

.card-border-light {
/* stylelint-disable-next-line custom-property-pattern */
border: 1px solid var(--v-greyBorder-lighten1);

&:not(:first-child) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@
[DELAYED_VALIDATION]: true,
};

let reorderedItems = [...this.sortedItems];
const reorderedItems = [...this.sortedItems];
reorderedItems.splice(newItem.order, 0, newItem);

let newOrders = this.items.map(item => ({
const newOrders = this.items.map(item => ({
...assessmentItemKey(item),
order: reorderedItems.indexOf(item),
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@

&:hover {
cursor: pointer;
/* stylelint-disable-next-line custom-property-pattern */
background-color: var(--v-greyBackground-base);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@
bottom: 0;
left: 0;
background-color: rgba(153, 97, 137, 0.2);
border: 5px solid var(--v-draggableDropOverlay-base);
/* stylelint-disable-next-line custom-property-pattern */
border: 5px solidvar(--v-draggabledropoverlay-base);
}

</style>
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@

import { mapGetters } from 'vuex';

import ContentNodeContextMenu from './ContentNodeContextMenu';
import ContentNodeOptions from './ContentNodeOptions';
import ContentNodeListItem from './ContentNodeListItem';
import ContentNodeOptions from './ContentNodeOptions';
import ContentNodeContextMenu from './ContentNodeContextMenu';
import Checkbox from 'shared/views/form/Checkbox';
import IconButton from 'shared/views/IconButton';
import DraggableItem from 'shared/views/draggable/DraggableItem';
Expand Down Expand Up @@ -227,6 +227,7 @@
height: 0;
overflow: hidden;
content: ' ';
/* stylelint-disable-next-line custom-property-pattern */
background: var(--v-draggableDropZone-base);
transition: height ease 0.2s, bottom ease 0.2s;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@
<script>

import camelCase from 'lodash/camelCase';
import ContentNodeValidator from '../ContentNodeValidator';
import ContentNodeChangedIcon from '../ContentNodeChangedIcon';
import TaskProgress from '../../views/progress/TaskProgress';
import ContentNodeChangedIcon from '../ContentNodeChangedIcon';
import ContentNodeValidator from '../ContentNodeValidator';
import { ContentLevels, Categories, NEW_OBJECT } from 'shared/constants';
import { ContentKindsNames } from 'shared/leUtils/ContentKinds';
import { RolesNames } from 'shared/leUtils/Roles';
Expand Down Expand Up @@ -421,6 +421,7 @@
transition: background-color ease 500ms;

.highlight & {
/* stylelint-disable-next-line custom-property-pattern */
background-color: var(--v-greenHighlightBackground-base);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
...mapActions('clipboard', ['copy']),
newTopicNode() {
this.trackAction('New topic');
let nodeData = {
const nodeData = {
parent: this.nodeId,
kind: 'topic',
};
Expand Down
Loading