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 Nov 28, 2024
1 parent cea7347 commit 3e359e3
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
:text="$tr('numbeOfSelectedResourcesLabel', { count: workingResources.length })"
:primary="true"
:to="goToPreviewSelection()"
:style="{ marginRight: '1em' , marginTop: '0.5em' }"
:style="{ marginRight: '1em', marginTop: '0.5em' }"
/>

<KRouterLink
Expand Down Expand Up @@ -568,19 +568,20 @@
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: {
message: '{count} {count, plural, one {resource} other {resources}}',
context: "Only translate 'resource' and 'resources'.",
},
numbeOfSelectedResourcesLabel:{
message:'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} '
numbeOfSelectedResourcesLabel: {
message:
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} ',
},
selectionInformation: {
message:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
ReportsLessonTabs,
workingResourcesBackup,
REPORTS_LESSON_TABS_ID,
showSidePanel:true,
showSidePanel: true,
};
},
computed: {
Expand Down Expand Up @@ -361,9 +361,10 @@
context: 'Allows user to undo an action.',
},
numberOfSelectedResource: {
message: '{count, number, integer} {count, plural, one {resource selected} other {resources selected}}',
context:'Indicates the number of resources selected'
}
message:
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}}',
context: 'Indicates the number of resources selected',
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
:text="$tr('numbeOfSelectedResourcesLabel', { 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 Down Expand Up @@ -157,12 +157,12 @@
saveAndFinishAction$,
};
},
data(){
data() {
return {
PageNames,
}
};
},
computed:{
computed: {
...mapState('lessonSummary', ['workingResources']),
},
methods: {
Expand All @@ -176,10 +176,12 @@
context:
"In the 'Manage lesson resources' coaches can add new/remove resource material to a lesson.",
},
numbeOfSelectedResourcesLabel:{
message:'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} ',
context:"This is the label that shows the number of resources selected in the lesson resource selection page"
}
numbeOfSelectedResourcesLabel: {
message:
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} ',
context:
'This is the label that shows the number of resources selected in the lesson resource selection page',
},
},
};
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 3e359e3

Please sign in to comment.