Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored and AllanOXDi committed Dec 5, 2024
1 parent 5bce015 commit 02a953e
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
:text="numberOfSelectedResource$({ count: workingResources.length })"
:primary="true"
:to="goToPreviewSelection()"
:style="{ marginRight: '1em' , marginTop: '0.5em' }"
:style="{ marginRight: '1em', marginTop: '0.5em' }"
/>

<KRouterLink
Expand Down Expand Up @@ -128,6 +128,7 @@
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
import useUser from 'kolibri/composables/useUser';
import useSnackbar from 'kolibri/composables/useSnackbar';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import commonCoach from '../../common';
import CoachAppBarPage from '../../CoachAppBarPage';
import CoachImmersivePage from '../../CoachImmersivePage';
Expand All @@ -137,7 +138,6 @@
import ResourceSelectionBreadcrumbs from './SearchTools/ResourceSelectionBreadcrumbs';
import ContentCardList from './ContentCardList';
import BookmarkIcon from './LessonContentCard/BookmarkIcon';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
export default {
// this is inaccurately named because it applies to exams also
Expand All @@ -162,7 +162,7 @@
const { windowIsSmall } = useKResponsiveWindow();
const { getUserPermissions } = useUser();
const { createSnackbar, clearSnackbar } = useSnackbar();
const {numberOfSelectedResource$ } = searchAndFilterStrings;
const { numberOfSelectedResource$ } = searchAndFilterStrings;
return {
windowIsSmall,
getUserPermissions,
Expand Down Expand Up @@ -571,11 +571,11 @@
topicsLink(topicId) {
return this.topicListingLink({ ...this.$route.params, topicId });
},
goToPreviewSelection(){
return{
name: PageNames.LESSON_PREVIEW_SELECTED_RESOURCES
}
}
goToPreviewSelection() {
return {
name: PageNames.LESSON_PREVIEW_SELECTED_RESOURCES,
};
},
},
$trs: {
resources: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
:text="numberOfSelectedResource$({ count: workingResources.length })"
:primary="true"
:to="{ name: PageNames.LESSON_PREVIEW_SELECTED_RESOURCES }"
:style="{ marginRight: '1em' , marginTop: '0.5em' }"
:style="{ marginRight: '1em', marginTop: '0.5em' }"
/>
<KButton
primary
Expand All @@ -122,8 +122,8 @@
import ChannelResource from 'kolibri-common/apiResources/ChannelResource';
import AccessibleChannelCard from 'kolibri-common/components/Cards/AccessibleChannelCard.vue';
import { mapState } from 'vuex';
import { PageNames } from '../../../../constants';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import { PageNames } from '../../../../constants';
export default {
name: 'LessonResourceSelection',
Expand Down Expand Up @@ -184,15 +184,15 @@
selectFromBookmarks$,
searchLabel$,
saveAndFinishAction$,
numberOfSelectedResource$
numberOfSelectedResource$,
};
},
data(){
data() {
return {
PageNames,
}
};
},
computed:{
computed: {
...mapState('lessonSummary', ['workingResources']),
},
methods: {
Expand All @@ -205,7 +205,7 @@
message: 'Manage lesson resources',
context:
"In the 'Manage lesson resources' coaches can add new/remove resource material to a lesson.",
}
},
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>

<SidePanelModal
alignment="right"
sidePanelWidth="700px"
Expand All @@ -7,14 +8,17 @@
@shouldFocusFirstEl="() => null"
>
<template #header>
<div :style="{ display:'inline-flex' }">
<div :style="{ display: 'inline-flex' }">
<KIconButton
v-if="true"
icon="back"
@click="$router.go(-1)"
/>
<h1 :style="{ fontWeight: '600', fontSize: '18px' }" class="side-panel-title">
{{ numberOfSelectedResource$({ count : resources.length })}}
<h1
:style="{ fontWeight: '600', fontSize: '18px' }"
class="side-panel-title"
>
{{ numberOfSelectedResource$({ count: resources.length }) }}
</h1>
</div>
</template>
Expand All @@ -26,7 +30,6 @@
@removeResource="removeResource"
/>


<template #bottomNavigation>
<div class="bottom-buttons-style">
<KButton
Expand All @@ -46,56 +49,55 @@
import SidePanelModal from 'kolibri-common/components/SidePanelModal';
import { mapState } from 'vuex';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import SelectedResources from './SelectedResources';
import { PageNames } from '../../../../constants';
import commonCoach from '../../../common';
import SelectedResources from './SelectedResources';
export default {
name:'ManageSelectedLessonResources',
name: 'ManageSelectedLessonResources',
components: {
SidePanelModal,
SelectedResources
SelectedResources,
},
mixins: [commonCoach],
setup() {
const { saveLessonResources$,numberOfSelectedResource$ } =
searchAndFilterStrings;
const { saveLessonResources$, numberOfSelectedResource$ } = searchAndFilterStrings;
return {
saveLessonResources$,
numberOfSelectedResource$
numberOfSelectedResource$,
};
},
},
computed: {
...mapState('lessonSummary', ['currentLesson', 'workingResources','resourceCache']),
lessonOrderListButtonBorder(){
...mapState('lessonSummary', ['currentLesson', 'workingResources', 'resourceCache']),
lessonOrderListButtonBorder() {
return {
borderBottom: `1px solid ${this.$themePalette.grey.v_200}`,
height:`4em`,
marginTop:`0.5em`
height: `4em`,
marginTop: `0.5em`,
};
},
},
data(){
data() {
return {
PageNames,
resources :[]
}
resources: [],
};
},
mounted(){
mounted() {
setTimeout(() => {
this.getResources();
}, 2000);
},
methods:{
removeResource(id){
methods: {
removeResource(id) {
this.resources = this.resources.filter(lesson => lesson.id !== id);
},
recipients() {
return this.group
? this.getLearnersForGroups([this.group.id])
: this.getLearnersForLesson(this.currentLesson);
},
getResources(){
getResources() {
const response = this.workingResources.map(resource => {
const content = this.resourceCache[resource.contentnode_id];
if (!content) {
Expand All @@ -110,7 +112,6 @@
// tally,
};
const link = {};
if (link) {
tableRow.link = link;
Expand All @@ -119,11 +120,13 @@
return tableRow;
});
Promise.all(response).then((results) => {
this.resources = results;
}).catch((error) => {
console.error("An error occurred:", error);
});
Promise.all(response)
.then(results => {
this.resources = results;
})
.catch(error => {
console.error('An error occurred:', error);
});
},
resourceLink(resource) {
if (resource.hasAssignments) {
Expand All @@ -143,13 +146,14 @@
}
},
closeSidePanel() {
this.$router.push({ name: PageNames.LESSONS_ROOT , params: { classId: this.$route.params.classId }});
this.$router.push({
name: PageNames.LESSONS_ROOT,
params: { classId: this.$route.params.classId },
});
},
},
$trs:{
}
}
$trs: {},
};
</script>

Expand All @@ -168,4 +172,4 @@
border-top: 1px solid black;
}
</style>
</style>
Loading

0 comments on commit 02a953e

Please sign in to comment.