-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My downloads page #10137
Merged
marcellamaki
merged 17 commits into
learningequality:develop
from
AlexVelezLl:my-downloads-page
Mar 28, 2023
Merged
My downloads page #10137
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b8206de
[MyDownloads] Setup the new Kolibri module
AlexVelezLl 1387b00
My Downloads setup and head
AlexVelezLl 060d145
Downloads lists paginated
AlexVelezLl a55526d
Add mydownloads side nav in learn plugin
AlexVelezLl 13cb64e
Move mydownloads to learn plugin
AlexVelezLl 01ffab4
Set MyDownloadsPage as a Learn SPA
AlexVelezLl 6cfd0e9
Connect composition api and show loading downloads
AlexVelezLl a0ede41
Showing actual resources from composition api
AlexVelezLl 5cdb986
Use reactive downloads and loading and retain selectedItems through p…
AlexVelezLl a1eb91e
Storage info
AlexVelezLl 9c3c17e
Refactor filters
AlexVelezLl 9e2db91
move PaginatedListContainerWithBackend
AlexVelezLl 011ba8b
Strings update
AlexVelezLl 8e1b6f3
View and remove downloads
AlexVelezLl f3f6c77
Removing unused code
AlexVelezLl 7cbc6b7
Empty list and remove myLibrarySize
AlexVelezLl 680f1c4
Fix failing actions
AlexVelezLl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import PageRoot from 'kolibri.coreVue.components.PageRoot'; | ||
import routes from './routes'; | ||
import pluginModule from './modules/pluginModule'; | ||
import KolibriApp from 'kolibri_app'; | ||
|
||
class MyDownloadsModule extends KolibriApp { | ||
get routes() { | ||
return routes; | ||
} | ||
get RootVue() { | ||
return PageRoot; | ||
} | ||
get pluginModule() { | ||
return pluginModule; | ||
} | ||
ready() { | ||
super.ready(); | ||
} | ||
} | ||
|
||
export default new MyDownloadsModule(); |
7 changes: 7 additions & 0 deletions
7
kolibri/plugins/learn/assets/src/my_downloads/modules/pluginModule.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default { | ||
state() { | ||
return {}; | ||
}, | ||
actions: {}, | ||
mutations: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import store from 'kolibri.coreVue.vuex.store'; | ||
import redirectBrowser from 'kolibri.utils.redirectBrowser'; | ||
import MyDownloadsPage from './views/MyDownloads'; | ||
|
||
export default [ | ||
{ | ||
path: '/', | ||
name: 'MY_DOWNLOADS', | ||
component: MyDownloadsPage, | ||
beforeEnter(to, from, next) { | ||
if (!store.getters.isUserLoggedIn) { | ||
redirectBrowser(); | ||
} else { | ||
next(); | ||
} | ||
}, | ||
}, | ||
]; |
51 changes: 51 additions & 0 deletions
51
...bri/plugins/learn/assets/src/my_downloads/views/DownloadsList/ConfirmationDeleteModal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
|
||
<KModal | ||
:title="coreString('removeFromLibrary')" | ||
:submitText="coreString('removeAction')" | ||
:cancelText="coreString('cancelAction')" | ||
@submit="removeResources" | ||
@cancel="$emit('cancel')" | ||
> | ||
{{ message }} | ||
</KModal> | ||
|
||
</template> | ||
|
||
|
||
<script> | ||
|
||
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings'; | ||
|
||
export default { | ||
name: 'ConfirmationDeleteModal', | ||
mixins: [commonCoreStrings], | ||
props: { | ||
resourcesToDelete: { | ||
type: Array, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
message() { | ||
if (this.resourcesToDelete.length === 1) { | ||
return this.coreString('removeResourceText'); | ||
} | ||
return this.coreString('removeResourcesText'); | ||
}, | ||
}, | ||
methods: { | ||
removeResources() { | ||
this.$emit('success'); | ||
}, | ||
}, | ||
}; | ||
|
||
</script> | ||
|
||
|
||
<style lang="scss" scoped> | ||
|
||
@import '~kolibri-design-system/lib/styles/definitions'; | ||
|
||
</style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didnt find a better solution for getting the url of the content renderer to move from my_downloads to learn :/. Due to the fact that they are differents SPA they dont have the same router object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems tractable, if a little complex. Another option here would be to create a content preview page within the downloads SPA, but this can work for now, especially as they both live in the same plugin, so cannot be deactivated separately.
It's possible that some of the work that @marcellamaki is doing in her app bar PR could be reused here to simplify this slightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we may be able to repurpose that here, and once this is merged, I can also do a follow up to change the side navigation item to match the new
CoreMenuOption
API @rtibbles