diff --git a/kolibri/core/assets/src/views/ContentIcon.vue b/kolibri/core/assets/src/views/ContentIcon.vue
index cf3fe43f2e6..8bea9f1569f 100644
--- a/kolibri/core/assets/src/views/ContentIcon.vue
+++ b/kolibri/core/assets/src/views/ContentIcon.vue
@@ -120,7 +120,7 @@
return validateContentNodeKind(value, [USER]);
},
},
- colorstyle: {
+ colorStyle: {
type: String,
default: 'action',
},
diff --git a/kolibri/core/assets/src/views/ContentRenderer/index.vue b/kolibri/core/assets/src/views/ContentRenderer/index.vue
index e10cc135d70..cfd77547373 100644
--- a/kolibri/core/assets/src/views/ContentRenderer/index.vue
+++ b/kolibri/core/assets/src/views/ContentRenderer/index.vue
@@ -67,10 +67,6 @@
UiAlert,
},
props: {
- id: {
- type: String,
- required: true,
- },
kind: {
type: String,
required: true,
@@ -79,14 +75,6 @@
type: Array,
default: () => [],
},
- contentId: {
- type: String,
- default: '',
- },
- channelId: {
- type: String,
- default: '',
- },
available: {
type: Boolean,
default: false,
diff --git a/kolibri/core/assets/src/views/ExamReport/PageStatus.vue b/kolibri/core/assets/src/views/ExamReport/PageStatus.vue
index 751bb35492f..1b73e4db2d9 100644
--- a/kolibri/core/assets/src/views/ExamReport/PageStatus.vue
+++ b/kolibri/core/assets/src/views/ExamReport/PageStatus.vue
@@ -43,7 +43,6 @@
import KGridItem from 'kolibri.coreVue.components.KGridItem';
import ProgressIcon from 'kolibri.coreVue.components.ProgressIcon';
import ElapsedTime from 'kolibri.coreVue.components.ElapsedTime';
- import { ContentNodeKinds } from 'kolibri.coreVue.vuex.constants';
import KLabeledIcon from 'kolibri.coreVue.components.KLabeledIcon';
import KIcon from 'kolibri.coreVue.components.KIcon';
@@ -96,9 +95,6 @@
// Either return in completed or in progress
return this.completed ? 1 : 0.1;
},
- kind() {
- return ContentNodeKinds.EXAM;
- },
},
};
diff --git a/kolibri/core/assets/src/views/ExamReport/index.vue b/kolibri/core/assets/src/views/ExamReport/index.vue
index 3f03376fbd1..dc2916ed0eb 100644
--- a/kolibri/core/assets/src/views/ExamReport/index.vue
+++ b/kolibri/core/assets/src/views/ExamReport/index.vue
@@ -38,12 +38,10 @@
/>
looseEqual(this.highlightedOption, option));
},
- // Returns the index of the currently selected option, -1 if multi-select
- selectedIndex() {
- if (this.multiple) {
- return -1;
- }
- return this.options.findIndex(option => looseEqual(this.value, option));
- },
-
// Returns an array containing the options and extra annotations
annotatedOptions() {
const options = JSON.parse(JSON.stringify(this.options));
diff --git a/kolibri/core/assets/src/views/KTooltip/Popper.vue b/kolibri/core/assets/src/views/KTooltip/Popper.vue
index 3ca8f7eb7ea..167124e09de 100644
--- a/kolibri/core/assets/src/views/KTooltip/Popper.vue
+++ b/kolibri/core/assets/src/views/KTooltip/Popper.vue
@@ -185,7 +185,6 @@
referenceElm: null,
popperJS: null,
showPopper: false,
- currentPlacement: '',
popperOptions: {
placement: 'bottom',
computeStyle: {
diff --git a/kolibri/core/assets/src/views/icons/KLabeledIcon.vue b/kolibri/core/assets/src/views/icons/KLabeledIcon.vue
index 966884bc897..4704ec829e6 100644
--- a/kolibri/core/assets/src/views/icons/KLabeledIcon.vue
+++ b/kolibri/core/assets/src/views/icons/KLabeledIcon.vue
@@ -17,15 +17,6 @@
export default {
name: 'KLabeledIcon',
components: {},
- props: {
- /**
- * Whether the label should wrap
- */
- nowrap: {
- type: Boolean,
- default: false,
- },
- },
};
diff --git a/kolibri/core/assets/test/content-renderer.spec.js b/kolibri/core/assets/test/content-renderer.spec.js
index 6723699a33e..934c7e9e6e2 100644
--- a/kolibri/core/assets/test/content-renderer.spec.js
+++ b/kolibri/core/assets/test/content-renderer.spec.js
@@ -23,7 +23,6 @@ describe('ContentRenderer Component', () => {
function defaultPropsDataFromFiles(files = defaultFiles) {
return {
- id: 'testing',
kind: 'test',
files,
};
diff --git a/kolibri/core/assets/test/views/KTooltipExample.vue b/kolibri/core/assets/test/views/KTooltipExample.vue
index 0974367ef7e..01ca796acc1 100644
--- a/kolibri/core/assets/test/views/KTooltipExample.vue
+++ b/kolibri/core/assets/test/views/KTooltipExample.vue
@@ -32,11 +32,6 @@
required: false,
default: () => {},
},
- kTooltipText: {
- type: String,
- required: false,
- default: '',
- },
},
};
diff --git a/kolibri/plugins/coach/assets/src/views/common/HeaderTabs/HeaderTab.vue b/kolibri/plugins/coach/assets/src/views/common/HeaderTabs/HeaderTab.vue
index cf6d1d34f62..0056cb292c3 100644
--- a/kolibri/plugins/coach/assets/src/views/common/HeaderTabs/HeaderTab.vue
+++ b/kolibri/plugins/coach/assets/src/views/common/HeaderTabs/HeaderTab.vue
@@ -33,11 +33,6 @@
required: true,
},
},
- data() {
- return {
- active: null,
- };
- },
computed: {
activeClasses() {
// return both fixed and dynamic classes
diff --git a/kolibri/plugins/coach/assets/src/views/common/LearnerExerciseReport.vue b/kolibri/plugins/coach/assets/src/views/common/LearnerExerciseReport.vue
index b13664af013..7c92f27b34c 100644
--- a/kolibri/plugins/coach/assets/src/views/common/LearnerExerciseReport.vue
+++ b/kolibri/plugins/coach/assets/src/views/common/LearnerExerciseReport.vue
@@ -58,13 +58,11 @@
/>
a.id === b.id);
},
- filteredUsers() {
- return this.usersNotInClass.filter(user => userMatchesFilter(user, this.filterInput));
- },
sortedFilteredUsers() {
return filterAndSortUsers(this.usersNotInClass, user =>
userMatchesFilter(user, this.filterInput)
@@ -195,9 +192,6 @@
visibleFilteredUsers() {
return this.sortedFilteredUsers.slice(this.startRange, this.endRange);
},
- showConfirmEnrollmentModal() {
- return this.modalShown === true;
- },
emptyMessage() {
if (this.classUsers.length === 0) {
return this.$tr('noUsersExist');
diff --git a/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/ContentArea.vue b/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/ContentArea.vue
index 52426691295..0d895082121 100644
--- a/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/ContentArea.vue
+++ b/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/ContentArea.vue
@@ -5,15 +5,12 @@
{{ header }}
diff --git a/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/QuestionList.vue b/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/QuestionList.vue
index eedd0eb9876..366f8d6666e 100644
--- a/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/QuestionList.vue
+++ b/kolibri/plugins/coach/assets/src/views/plan/LessonContentPreviewPage/QuestionList.vue
@@ -60,13 +60,6 @@
validator: value => typeof value(0) === 'string',
},
},
- computed: {
- buttonAndHeaderBorder() {
- return {
- borderBottom: `2px solid ${this.$coreTextDisabled}`,
- };
- },
- },
};
diff --git a/kolibri/plugins/coach/assets/src/views/plan/LessonsRootPage/index.vue b/kolibri/plugins/coach/assets/src/views/plan/LessonsRootPage/index.vue
index 424bf305e0a..0ae3642d0dd 100644
--- a/kolibri/plugins/coach/assets/src/views/plan/LessonsRootPage/index.vue
+++ b/kolibri/plugins/coach/assets/src/views/plan/LessonsRootPage/index.vue
@@ -109,11 +109,7 @@
import KSelect from 'kolibri.coreVue.components.KSelect';
import KLabeledIcon from 'kolibri.coreVue.components.KLabeledIcon';
import KIcon from 'kolibri.coreVue.components.KIcon';
- import {
- ContentNodeKinds,
- CollectionKinds,
- ERROR_CONSTANTS,
- } from 'kolibri.coreVue.vuex.constants';
+ import { CollectionKinds, ERROR_CONSTANTS } from 'kolibri.coreVue.vuex.constants';
import CatchErrors from 'kolibri.utils.CatchErrors';
import { crossComponentTranslator } from 'kolibri.utils.i18n';
import LessonActive from '../../common/LessonActive';
@@ -148,7 +144,6 @@
data() {
return {
showModal: false,
- lessonKind: ContentNodeKinds.LESSON,
filterSelection: {},
};
},
diff --git a/kolibri/plugins/coach/assets/src/views/reports/LearnerExerciseDetailPage/LearnerExerciseReportOld.vue b/kolibri/plugins/coach/assets/src/views/reports/LearnerExerciseDetailPage/LearnerExerciseReportOld.vue
index 13b7be8d1b7..a0985393f99 100644
--- a/kolibri/plugins/coach/assets/src/views/reports/LearnerExerciseDetailPage/LearnerExerciseReportOld.vue
+++ b/kolibri/plugins/coach/assets/src/views/reports/LearnerExerciseDetailPage/LearnerExerciseReportOld.vue
@@ -30,14 +30,11 @@
/>
@@ -98,9 +98,6 @@
recipients() {
return this.getLearnersForGroups([this.$route.params.groupId]);
},
- avgTime() {
- return this.getContentAvgTimeSpent(this.$route.params.resourceId, this.recipients);
- },
tally() {
return this.getContentStatusTally(this.$route.params.resourceId, this.recipients);
},
diff --git a/kolibri/plugins/coach/assets/src/views/reports/ReportsGroupReportQuizHeader.vue b/kolibri/plugins/coach/assets/src/views/reports/ReportsGroupReportQuizHeader.vue
index 86060901e2d..0cc3dec8485 100644
--- a/kolibri/plugins/coach/assets/src/views/reports/ReportsGroupReportQuizHeader.vue
+++ b/kolibri/plugins/coach/assets/src/views/reports/ReportsGroupReportQuizHeader.vue
@@ -73,9 +73,6 @@
recipients() {
return this.getLearnersForGroups([this.$route.params.groupId]);
},
- tally() {
- return this.getExamStatusTally(this.exam.id, this.recipients);
- },
},
$trs: {
back: 'All quizzes',
diff --git a/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonEditorPage.vue b/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonEditorPage.vue
index 7c370293894..e862ea6573e 100644
--- a/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonEditorPage.vue
+++ b/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonEditorPage.vue
@@ -33,16 +33,6 @@
LessonDetailEditor,
},
mixins: [commonCoach],
- data() {
- return {
- lessonTitle: 'Lesson A',
- lessonDescription: 'Ipsum lorem',
- selectedCollectionIds: ['a'],
- availableGroups: [{ name: 'Group A', id: 'a' }, { name: 'Group B', id: 'b' }],
- selectedClassroomId: 'x',
- isActive: true,
- };
- },
$trs: {},
};
diff --git a/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonHeader.vue b/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonHeader.vue
index 0ecda9af876..ab82ad5195f 100644
--- a/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonHeader.vue
+++ b/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonHeader.vue
@@ -79,6 +79,7 @@
components: {},
mixins: [commonCoach],
computed: {
+ /** TODO COACH
actionOptions() {
return [
{ label: this.coachStrings.$tr('editDetailsAction'), value: 'ReportsLessonEditorPage' },
@@ -88,6 +89,7 @@
},
];
},
+ */
lesson() {
return this.lessonMap[this.$route.params.lessonId];
},
diff --git a/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonReportPage.vue b/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonReportPage.vue
index e4d17785edb..27a0a0115a3 100644
--- a/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonReportPage.vue
+++ b/kolibri/plugins/coach/assets/src/views/reports/ReportsLessonReportPage.vue
@@ -81,6 +81,7 @@
emptyMessage() {
return LessonSummaryPageStrings.$tr('noResourcesInLesson');
},
+ /** TODO COACH
actionOptions() {
return [
{ label: this.coachStrings.$tr('editDetailsAction'), value: 'ReportsLessonEditorPage' },
@@ -90,6 +91,7 @@
},
];
},
+ */
lesson() {
return this.lessonMap[this.$route.params.lessonId];
},
diff --git a/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizEditorPage.vue b/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizEditorPage.vue
index a569ab38eec..6a11707b28f 100644
--- a/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizEditorPage.vue
+++ b/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizEditorPage.vue
@@ -30,16 +30,6 @@
QuizDetailEditor,
},
mixins: [commonCoach],
- data() {
- return {
- lessonTitle: 'Lesson A',
- lessonDescription: 'Ipsum lorem',
- selectedCollectionIds: ['a'],
- availableGroups: [{ name: 'Group A', id: 'a' }, { name: 'Group B', id: 'b' }],
- selectedClassroomId: 'x',
- isActive: true,
- };
- },
$trs: {},
};
diff --git a/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizHeader.vue b/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizHeader.vue
index 25c236cda81..3ad4516339b 100644
--- a/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizHeader.vue
+++ b/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizHeader.vue
@@ -80,12 +80,14 @@
avgScore() {
return this.getExamAvgScore(this.$route.params.quizId, this.recipients);
},
+ /** TODO COACH
actionOptions() {
return [
{ label: this.coachStrings.$tr('previewAction'), value: 'ReportsQuizPreviewPage' },
{ label: this.coachStrings.$tr('editDetailsAction'), value: 'ReportsQuizEditorPage' },
];
},
+ */
exam() {
return this.examMap[this.$route.params.quizId];
},
diff --git a/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectNetworkAddressModal/SelectAddressForm.vue b/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectNetworkAddressModal/SelectAddressForm.vue
index 2b1ba4768e3..e14f65391f4 100644
--- a/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectNetworkAddressModal/SelectAddressForm.vue
+++ b/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectNetworkAddressModal/SelectAddressForm.vue
@@ -99,23 +99,26 @@
submitDisabled() {
return (
this.selectedAddressId === '' ||
- this.stage === Stages.FETCHING_ADDRESSES ||
- this.stage === Stages.DELETING_ADDRESS
+ this.stage === this.Stages.FETCHING_ADDRESSES ||
+ this.stage === this.Stages.DELETING_ADDRESS
);
},
newAddressButtonDisabled() {
- return this.stage === Stages.FETCHING_ADDRESSES;
+ return this.stage === this.Stages.FETCHING_ADDRESSES;
},
requestsSucessful() {
return (
- this.stage === Stages.FETCHING_SUCCESSFUL || this.stage === Stages.DELETING_SUCCESSFUL
+ this.stage === this.Stages.FETCHING_SUCCESSFUL ||
+ this.stage === this.Stages.DELETING_SUCCESSFUL
);
},
requestsFailed() {
- return this.stage === Stages.FETCHING_FAILED || this.stage === Stages.DELETING_FAILED;
+ return (
+ this.stage === this.Stages.FETCHING_FAILED || this.stage === this.Stages.DELETING_FAILED
+ );
},
uiAlertProps() {
- if (this.stage === Stages.FETCHING_ADDRESSES) {
+ if (this.stage === this.Stages.FETCHING_ADDRESSES) {
return {
text: this.$tr('fetchingAddressesText'),
type: 'info',
@@ -127,13 +130,13 @@
type: 'info',
};
}
- if (this.stage === Stages.FETCHING_FAILED) {
+ if (this.stage === this.Stages.FETCHING_FAILED) {
return {
text: this.$tr('fetchingFailedText'),
type: 'error',
};
}
- if (this.stage === Stages.DELETING_FAILED) {
+ if (this.stage === this.Stages.DELETING_FAILED) {
return {
text: this.$tr('deletingFailedText'),
type: 'error',
@@ -154,16 +157,16 @@
},
methods: {
refreshAddressList() {
- this.stage = Stages.FETCHING_ADDRESSES;
+ this.stage = this.Stages.FETCHING_ADDRESSES;
this.addresses = [];
return fetchAddresses(this.isImportingMore ? this.transferredChannel.id : '')
.then(addresses => {
this.addresses = addresses;
this.resetSelectedAddress();
- this.stage = Stages.FETCHING_SUCCESSFUL;
+ this.stage = this.Stages.FETCHING_SUCCESSFUL;
})
.catch(() => {
- this.stage = Stages.FETCHING_FAILED;
+ this.stage = this.Stages.FETCHING_FAILED;
});
},
resetSelectedAddress() {
@@ -175,16 +178,16 @@
}
},
removeAddress(id) {
- this.stage = Stages.DELETING_ADDRESS;
+ this.stage = this.Stages.DELETING_ADDRESS;
return deleteAddress(id)
.then(() => {
this.addresses = this.addresses.filter(a => a.id !== id);
this.resetSelectedAddress(this.addresses);
- this.stage = Stages.DELETING_SUCCESSFUL;
+ this.stage = this.Stages.DELETING_SUCCESSFUL;
this.$emit('removed_address');
})
.catch(() => {
- this.stage = Stages.DELETING_FAILED;
+ this.stage = this.Stages.DELETING_FAILED;
});
},
handleSubmit() {
diff --git a/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectTransferSourceModal/SelectDriveModal.vue b/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectTransferSourceModal/SelectDriveModal.vue
index f0638ce64a4..5f417bd6ebf 100644
--- a/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectTransferSourceModal/SelectDriveModal.vue
+++ b/kolibri/plugins/device_management/assets/src/views/ManageContentPage/SelectTransferSourceModal/SelectDriveModal.vue
@@ -58,7 +58,6 @@
return {
driveStatus: '',
selectedDriveId: '',
- showError: false,
};
},
computed: {
diff --git a/kolibri/plugins/device_management/assets/src/views/ManageContentPage/TaskProgress.vue b/kolibri/plugins/device_management/assets/src/views/ManageContentPage/TaskProgress.vue
index ad3d98d39bd..79edff46d66 100644
--- a/kolibri/plugins/device_management/assets/src/views/ManageContentPage/TaskProgress.vue
+++ b/kolibri/plugins/device_management/assets/src/views/ManageContentPage/TaskProgress.vue
@@ -82,7 +82,6 @@
type: Number,
required: true,
},
- id: RequiredString,
cancellable: {
type: Boolean,
required: true,
@@ -108,7 +107,7 @@
return this.$tr('downloadingChannelContents');
}
- if (this.status === TaskStatuses.RUNNING) {
+ if (this.status === this.TaskStatuses.RUNNING) {
switch (this.type) {
case TaskTypes.REMOTE_IMPORT:
case TaskTypes.LOCAL_IMPORT:
@@ -139,13 +138,15 @@
return '';
},
taskHasFailed() {
- return this.status === TaskStatuses.FAILED;
+ return this.status === this.TaskStatuses.FAILED;
},
taskHasCompleted() {
- return this.status === TaskStatuses.COMPLETED;
+ return this.status === this.TaskStatuses.COMPLETED;
},
taskIsPreparing() {
- return this.status === TaskStatuses.QUEUED || this.status === TaskStatuses.SCHEDULED;
+ return (
+ this.status === this.TaskStatuses.QUEUED || this.status === this.TaskStatuses.SCHEDULED
+ );
},
formattedPercentage() {
return this.percentage * 100;
diff --git a/kolibri/plugins/device_management/assets/src/views/SelectContentPage/ContentTreeViewer.vue b/kolibri/plugins/device_management/assets/src/views/SelectContentPage/ContentTreeViewer.vue
index 89d388b22f8..7708b905cce 100644
--- a/kolibri/plugins/device_management/assets/src/views/SelectContentPage/ContentTreeViewer.vue
+++ b/kolibri/plugins/device_management/assets/src/views/SelectContentPage/ContentTreeViewer.vue
@@ -61,7 +61,6 @@
import KCheckbox from 'kolibri.coreVue.components.KCheckbox';
import KBreadcrumbs from 'kolibri.coreVue.components.KBreadcrumbs';
import { ContentNodeKinds } from 'kolibri.coreVue.vuex.constants';
- import last from 'lodash/last';
import every from 'lodash/every';
import omit from 'lodash/omit';
import { navigateToTopicUrl } from '../../routes/wizardTransitionRoutes';
@@ -157,11 +156,6 @@
!this.inExportMode
);
},
- breadcrumbItems() {
- const items = [...this.breadcrumbs];
- delete last(items).link;
- return items;
- },
},
methods: {
...mapActions('manageContent/wizard', ['addNodeForTransfer', 'removeNodeForTransfer']),
diff --git a/kolibri/plugins/device_management/assets/src/views/SelectContentPage/index.vue b/kolibri/plugins/device_management/assets/src/views/SelectContentPage/index.vue
index 5c1fab2c2ba..7be29caf82d 100644
--- a/kolibri/plugins/device_management/assets/src/views/SelectContentPage/index.vue
+++ b/kolibri/plugins/device_management/assets/src/views/SelectContentPage/index.vue
@@ -9,7 +9,6 @@
a.id === b.id);
},
- filteredUsers() {
- return this.usersNotInClass.filter(user => userMatchesFilter(user, this.filterInput));
- },
sortedFilteredUsers() {
return filterAndSortUsers(this.usersNotInClass, user =>
userMatchesFilter(user, this.filterInput)
@@ -168,9 +164,6 @@
visibleFilteredUsers() {
return this.sortedFilteredUsers.slice(this.startRange, this.endRange);
},
- showConfirmEnrollmentModal() {
- return this.modalShown === Modals.CONFIRM_ENROLLMENT;
- },
emptyMessage() {
if (this.facilityUsers.length === 0) {
return this.$tr('noUsersExist');
diff --git a/kolibri/plugins/facility_management/assets/src/views/DataPage/index.vue b/kolibri/plugins/facility_management/assets/src/views/DataPage/index.vue
index 83cee29b6b5..b027238eddc 100644
--- a/kolibri/plugins/facility_management/assets/src/views/DataPage/index.vue
+++ b/kolibri/plugins/facility_management/assets/src/views/DataPage/index.vue
@@ -100,11 +100,6 @@
DataPageTaskProgress,
},
mixins: [themeMixin],
- data() {
- return {
- lista: urls,
- };
- },
metaInfo() {
return {
title: this.$tr('documentTitle'),
@@ -144,9 +139,6 @@
cannotDownload() {
return isAndroidWebView();
},
- generatingCSVFile() {
- return this.inSummaryCSVCreation || this.inSessionCSVCreation;
- },
inDataExportPage() {
return this.pageName === PageNames.DATA_EXPORT_PAGE;
},
diff --git a/kolibri/plugins/facility_management/assets/src/views/UserPage/DeleteUserModal.vue b/kolibri/plugins/facility_management/assets/src/views/UserPage/DeleteUserModal.vue
index f677a7802c6..4e0c3b7df92 100644
--- a/kolibri/plugins/facility_management/assets/src/views/UserPage/DeleteUserModal.vue
+++ b/kolibri/plugins/facility_management/assets/src/views/UserPage/DeleteUserModal.vue
@@ -37,10 +37,6 @@
type: String,
required: true,
},
- name: {
- type: String,
- required: true,
- },
username: {
type: String,
required: true,
diff --git a/kolibri/plugins/facility_management/assets/src/views/UserPage/ResetUserPasswordModal.vue b/kolibri/plugins/facility_management/assets/src/views/UserPage/ResetUserPasswordModal.vue
index 05ea1c4a6fa..bfc99da69e1 100644
--- a/kolibri/plugins/facility_management/assets/src/views/UserPage/ResetUserPasswordModal.vue
+++ b/kolibri/plugins/facility_management/assets/src/views/UserPage/ResetUserPasswordModal.vue
@@ -51,10 +51,6 @@
type: String,
required: true,
},
- name: {
- type: String,
- required: true,
- },
username: {
type: String,
required: true,
diff --git a/kolibri/plugins/facility_management/assets/src/views/UserPage/index.vue b/kolibri/plugins/facility_management/assets/src/views/UserPage/index.vue
index b28fea7b291..a30b760f001 100644
--- a/kolibri/plugins/facility_management/assets/src/views/UserPage/index.vue
+++ b/kolibri/plugins/facility_management/assets/src/views/UserPage/index.vue
@@ -62,14 +62,12 @@
diff --git a/kolibri/plugins/facility_management/assets/src/views/UserTable.vue b/kolibri/plugins/facility_management/assets/src/views/UserTable.vue
index 8b8ff592d9c..7afefa6fb8f 100644
--- a/kolibri/plugins/facility_management/assets/src/views/UserTable.vue
+++ b/kolibri/plugins/facility_management/assets/src/views/UserTable.vue
@@ -124,9 +124,6 @@
type: Array,
required: true,
},
- title: {
- type: String,
- },
emptyMessage: {
type: String,
},
diff --git a/kolibri/plugins/learn/assets/src/views/AssessmentWrapper/index.vue b/kolibri/plugins/learn/assets/src/views/AssessmentWrapper/index.vue
index 269e1943554..6f2c9b04dec 100644
--- a/kolibri/plugins/learn/assets/src/views/AssessmentWrapper/index.vue
+++ b/kolibri/plugins/learn/assets/src/views/AssessmentWrapper/index.vue
@@ -20,13 +20,10 @@ oriented data synchronization.
[],
},
- contentId: {
- type: String,
- default: '',
- },
channelId: {
type: String,
default: '',
diff --git a/kolibri/plugins/learn/assets/src/views/ContentCardGroupCarousel.vue b/kolibri/plugins/learn/assets/src/views/ContentCardGroupCarousel.vue
index 0480499f192..6f8751c2787 100644
--- a/kolibri/plugins/learn/assets/src/views/ContentCardGroupCarousel.vue
+++ b/kolibri/plugins/learn/assets/src/views/ContentCardGroupCarousel.vue
@@ -121,10 +121,10 @@
return this.isRtl ? 'right' : 'left';
},
contentSetSize() {
- if (this.elementWidth > 2 * contentCardWidth) {
- const numOfCards = Math.floor(this.elementWidth / contentCardWidth);
+ if (this.elementWidth > 2 * this.contentCardWidth) {
+ const numOfCards = Math.floor(this.elementWidth / this.contentCardWidth);
const numOfGutters = numOfCards - 1;
- const totalWidth = numOfCards * contentCardWidth + numOfGutters * gutterWidth;
+ const totalWidth = numOfCards * this.contentCardWidth + numOfGutters * this.gutterWidth;
if (this.elementWidth >= totalWidth) {
return numOfCards;
}
@@ -142,26 +142,26 @@
return this.contentSetEnd >= this.contents.length - 1;
},
contentSetStyles() {
- const cards = this.contentSetSize * contentCardWidth + horizontalShadowOffset;
- const gutters = (this.contentSetSize - 1) * gutterWidth;
+ const cards = this.contentSetSize * this.contentCardWidth + horizontalShadowOffset;
+ const gutters = (this.contentSetSize - 1) * this.gutterWidth;
const maxCardShadowOffset = 14; // determined by css styles on cards
const topShadowOffset = 10;
return {
- 'min-width': `${contentCardWidth}px`,
+ 'min-width': `${this.contentCardWidth}px`,
'overflow-x': 'hidden',
width: `${cards + gutters + maxCardShadowOffset}px`,
// Bottom shadow is a little bit bigger, so add a few pixels more
- height: `${contentCardWidth + maxCardShadowOffset + topShadowOffset + 3}px`,
+ height: `${this.contentCardWidth + maxCardShadowOffset + topShadowOffset + 3}px`,
position: 'relative',
'padding-top': `${topShadowOffset}px`,
};
},
contentControlsContainerStyles() {
- const cards = this.contentSetSize * contentCardWidth;
- const gutters = (this.contentSetSize - 1) * gutterWidth;
+ const cards = this.contentSetSize * this.contentCardWidth;
+ const gutters = (this.contentSetSize - 1) * this.gutterWidth;
return {
width: `${cards + gutters}px`,
- height: `${contentCardWidth}px`,
+ height: `${this.contentCardWidth}px`,
overflow: 'visible',
position: 'relative',
};
@@ -211,8 +211,8 @@
methods: {
positionCalc(index) {
const indexInSet = index - this.contentSetStart;
- const gutterOffset = indexInSet * gutterWidth;
- const cardOffset = indexInSet * contentCardWidth;
+ const gutterOffset = indexInSet * this.gutterWidth;
+ const cardOffset = indexInSet * this.contentCardWidth;
return { [this.animationAttr]: `${cardOffset + gutterOffset + horizontalShadowOffset}px` };
},
setStartPosition(el) {
@@ -220,8 +220,8 @@
// sets the initial spot from which cards will be sliding into place from
// direction depends on `panBackwards`
const originalPosition = parseInt(el.style[this.animationAttr], 10);
- const cards = this.contentSetSize * contentCardWidth;
- const gutters = this.contentSetSize * gutterWidth;
+ const cards = this.contentSetSize * this.contentCardWidth;
+ const gutters = this.contentSetSize * this.gutterWidth;
const carouselContainerOffset = cards + gutters;
const sign = this.panBackwards ? -1 : 1;
@@ -233,8 +233,8 @@
// moves cards from their starting point by their offset
// direction depends on `panBackwards`
const originalPosition = parseInt(el.style[this.animationAttr], 10);
- const cards = this.contentSetSize * contentCardWidth;
- const gutters = this.contentSetSize * gutterWidth;
+ const cards = this.contentSetSize * this.contentCardWidth;
+ const gutters = this.contentSetSize * this.gutterWidth;
const carouselContainerOffset = cards + gutters;
const sign = this.panBackwards ? 1 : -1;
diff --git a/kolibri/plugins/learn/assets/src/views/ContentPage.vue b/kolibri/plugins/learn/assets/src/views/ContentPage.vue
index 3247cad7ff9..0405163359b 100644
--- a/kolibri/plugins/learn/assets/src/views/ContentPage.vue
+++ b/kolibri/plugins/learn/assets/src/views/ContentPage.vue
@@ -15,13 +15,10 @@
0) {
- return breadcrumbs[breadcrumbs.length - 1];
- }
-
- return undefined;
- },
progress() {
if (this.isUserLoggedIn) {
// if there no attempts for this exercise, there is no progress
diff --git a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue
index b855208e368..f33def7d604 100644
--- a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue
+++ b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue
@@ -43,12 +43,9 @@
>
({
label: facility.name,
diff --git a/kolibri/plugins/user/assets/src/views/UserIndex.vue b/kolibri/plugins/user/assets/src/views/UserIndex.vue
index 5fd2779753e..519f10ed260 100644
--- a/kolibri/plugins/user/assets/src/views/UserIndex.vue
+++ b/kolibri/plugins/user/assets/src/views/UserIndex.vue
@@ -49,9 +49,6 @@
currentPage() {
return pageNameComponentMap[this.pageName] || null;
},
- navBarNeeded() {
- return this.pageName !== PageNames.SIGN_IN && this.pageName !== PageNames.SIGN_UP;
- },
PageNames() {
return PageNames;
},
diff --git a/packages/eslint-plugin-kolibri/lib/rules/vue-no-unused-properties.js b/packages/eslint-plugin-kolibri/lib/rules/vue-no-unused-properties.js
new file mode 100644
index 00000000000..9fa810c0330
--- /dev/null
+++ b/packages/eslint-plugin-kolibri/lib/rules/vue-no-unused-properties.js
@@ -0,0 +1,142 @@
+/**
+ * @fileoverview Disallow unused properties, data or computed properties.
+ */
+
+'use strict';
+
+const remove = require('lodash/remove');
+const utils = require('eslint-plugin-vue/lib/utils');
+
+const GROUP_PROPERTY = 'props';
+const GROUP_DATA = 'data';
+const GROUP_COMPUTED_PROPERTY = 'computed';
+const GROUP_WATCHER = 'watch';
+
+const PROPERTY_LABEL = {
+ [GROUP_PROPERTY]: 'property',
+ [GROUP_DATA]: 'data',
+ [GROUP_COMPUTED_PROPERTY]: 'computed property',
+};
+
+const getReferencesNames = references => {
+ if (!references || !references.length) {
+ return [];
+ }
+
+ return references.map(reference => {
+ if (!reference.id || !reference.id.name) {
+ return;
+ }
+
+ return reference.id.name;
+ });
+};
+
+const reportUnusedProperties = (context, properties) => {
+ if (!properties || !properties.length) {
+ return;
+ }
+
+ properties.forEach(property => {
+ context.report({
+ node: property.node,
+ message: `Unused ${PROPERTY_LABEL[property.groupName]} found: "${property.name}"`,
+ });
+ });
+};
+
+const create = context => {
+ let hasTemplate;
+ let rootTemplateEnd;
+ let unusedProperties = [];
+ let thisExpressionsVariablesNames = [];
+
+ const initialize = {
+ Program(node) {
+ if (context.parserServices.getTemplateBodyTokenStore == null) {
+ context.report({
+ loc: { line: 1, column: 0 },
+ message:
+ 'Use the latest vue-eslint-parser. See also https://vuejs.github.io/eslint-plugin-vue/user-guide/#what-is-the-use-the-latest-vue-eslint-parser-error.',
+ });
+ return;
+ }
+
+ hasTemplate = Boolean(node.templateBody);
+ },
+ };
+
+ const scriptVisitor = Object.assign(
+ {},
+ {
+ 'MemberExpression[object.type="ThisExpression"][property.type="Identifier"][property.name]'(
+ node
+ ) {
+ thisExpressionsVariablesNames.push(node.property.name);
+ },
+ },
+ utils.executeOnVue(context, obj => {
+ unusedProperties = Array.from(
+ utils.iterateProperties(obj, new Set([GROUP_PROPERTY, GROUP_DATA, GROUP_COMPUTED_PROPERTY]))
+ );
+
+ const watchers = Array.from(utils.iterateProperties(obj, new Set([GROUP_WATCHER])));
+ const watchersNames = watchers.map(watcher => watcher.name);
+
+ remove(unusedProperties, property => {
+ return (
+ thisExpressionsVariablesNames.includes(property.name) ||
+ watchersNames.includes(property.name)
+ );
+ });
+
+ if (!hasTemplate && unusedProperties.length) {
+ reportUnusedProperties(context, unusedProperties);
+ }
+ })
+ );
+
+ const templateVisitor = {
+ 'VExpressionContainer[expression!=null][references]'(node) {
+ const referencesNames = getReferencesNames(node.references);
+
+ remove(unusedProperties, property => {
+ return referencesNames.includes(property.name);
+ });
+ },
+ // save root template end location - just a helper to be used
+ // for a decision if a parser reached the end of the root template
+ "VElement[name='template']"(node) {
+ if (rootTemplateEnd) {
+ return;
+ }
+
+ rootTemplateEnd = node.loc.end;
+ },
+ "VElement[name='template']:exit"(node) {
+ if (node.loc.end !== rootTemplateEnd) {
+ return;
+ }
+
+ if (unusedProperties.length) {
+ reportUnusedProperties(context, unusedProperties);
+ }
+ },
+ };
+
+ return Object.assign(
+ {},
+ initialize,
+ utils.defineTemplateBodyVisitor(context, templateVisitor, scriptVisitor)
+ );
+};
+
+module.exports = {
+ meta: {
+ docs: {
+ description: 'Disallow unused properties, data or computed properties',
+ },
+ fixable: null,
+ },
+ create,
+};
diff --git a/packages/eslint-plugin-kolibri/tests/lib/rules/vue-no-unused-properties.spec.js b/packages/eslint-plugin-kolibri/tests/lib/rules/vue-no-unused-properties.spec.js
new file mode 100644
index 00000000000..b14ea1463f6
--- /dev/null
+++ b/packages/eslint-plugin-kolibri/tests/lib/rules/vue-no-unused-properties.spec.js
@@ -0,0 +1,668 @@
+'use strict';
+
+const RuleTester = require('eslint').RuleTester;
+const rule = require('../../../lib/rules/vue-no-unused-properties');
+
+const tester = new RuleTester({
+ parser: 'vue-eslint-parser',
+ parserOptions: {
+ ecmaVersion: 2018,
+ sourceType: 'module',
+ },
+});
+
+tester.run('vue-no-unused-properties', rule, {
+ valid: [
+ // a property used in a script expression
+ {
+ filename: 'test.vue',
+ code: `
+
+ `,
+ },
+
+ // a property being watched
+ {
+ filename: 'test.vue',
+ code: `
+
+ `,
+ },
+
+ // a property used as a template identifier
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ count }}
+
+
+
+ `,
+ },
+
+ // properties used in a template expression
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ count1 + count2 }}
+
+
+
+ `,
+ },
+
+ // a property used in v-if
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // a property used in v-for
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ color }}
+
+
+
+ `,
+ },
+
+ // a property used in v-html
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // a property passed in a component
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // a property used in v-on
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // data used in a script expression
+ {
+ filename: 'test.vue',
+ code: `
+
+ `,
+ },
+
+ // data being watched
+ {
+ filename: 'test.vue',
+ code: `
+
+ `,
+ },
+
+ // data used as a template identifier
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ count }}
+
+
+
+ `,
+ },
+
+ // data used in a template expression
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ count1 + count2 }}
+
+
+
+ `,
+ },
+
+ // data used in v-if
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // data used in v-for
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ color }}
+
+
+
+ `,
+ },
+
+ // data used in v-html
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // data used in v-model
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // data passed in a component
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // data used in v-on
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // computed property used in a script expression
+ {
+ filename: 'test.vue',
+ code: `
+
+ `,
+ },
+
+ // computed property being watched
+ {
+ filename: 'test.vue',
+ code: `
+
+ `,
+ },
+
+ // computed property used as a template identifier
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ count }}
+
+
+
+ `,
+ },
+
+ // computed properties used in a template expression
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ count1 + count2 }}
+
+
+
+ `,
+ },
+
+ // computed property used in v-if
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // computed property used in v-for
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ color }}
+
+
+
+ `,
+ },
+
+ // computed property used in v-html
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // computed property used in v-model
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // computed property passed in a component
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+
+ `,
+ },
+
+ // ignores unused data when marked with eslint-disable
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ cont }}
+
+
+
+ `,
+ },
+ ],
+
+ invalid: [
+ // unused property
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ cont }}
+
+
+
+ `,
+ errors: [
+ {
+ message: 'Unused property found: "count"',
+ line: 8,
+ },
+ ],
+ },
+
+ // unused data
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ cont }}
+
+
+
+ `,
+ errors: [
+ {
+ message: 'Unused data found: "count"',
+ line: 10,
+ },
+ ],
+ },
+
+ // unused computed property
+ {
+ filename: 'test.vue',
+ code: `
+
+ {{ cont }}
+
+
+
+ `,
+ errors: [
+ {
+ message: 'Unused computed property found: "count"',
+ line: 9,
+ },
+ ],
+ },
+ ],
+});
diff --git a/packages/kolibri-tools/.eslintrc.js b/packages/kolibri-tools/.eslintrc.js
index 2881d6ca349..a3d1793949f 100644
--- a/packages/kolibri-tools/.eslintrc.js
+++ b/packages/kolibri-tools/.eslintrc.js
@@ -121,5 +121,6 @@ module.exports = {
// Custom vue rules
'kolibri/vue-filename-and-component-name-match': ERROR,
'kolibri/vue-component-registration-casing': ERROR,
+ 'kolibri/vue-no-unused-properties': ERROR,
},
};