diff --git a/kolibri/core/package.json b/kolibri/core/package.json index dc62c88bbd5..013ae4af144 100644 --- a/kolibri/core/package.json +++ b/kolibri/core/package.json @@ -21,7 +21,7 @@ "js-cookie": "^3.0.5", "knuth-shuffle-seeded": "^1.0.6", "kolibri-constants": "0.2.6", - "kolibri-design-system": "4.4.0", + "kolibri-design-system": "5.0.0-rc1", "lockr": "0.8.5", "lodash": "^4.17.21", "loglevel": "^1.9.1", diff --git a/kolibri/plugins/learn/assets/src/views/LearnAppBarPage.vue b/kolibri/plugins/learn/assets/src/views/LearnAppBarPage.vue index 285d3317e2d..bf0578181ab 100644 --- a/kolibri/plugins/learn/assets/src/views/LearnAppBarPage.vue +++ b/kolibri/plugins/learn/assets/src/views/LearnAppBarPage.vue @@ -18,10 +18,7 @@ diff --git a/kolibri/plugins/learn/assets/src/views/StorageNotification.vue b/kolibri/plugins/learn/assets/src/views/StorageNotification.vue index 79854bd8a8a..76cccaa0a0c 100644 --- a/kolibri/plugins/learn/assets/src/views/StorageNotification.vue +++ b/kolibri/plugins/learn/assets/src/views/StorageNotification.vue @@ -13,7 +13,7 @@

- {{ getMessage() }} + {{ message }}

@@ -61,6 +61,7 @@ import { mapGetters } from 'vuex'; import useUser from 'kolibri.coreVue.composables.useUser'; import { useLocalStorage } from '@vueuse/core'; + import useKLiveRegion from 'kolibri-design-system/lib/composables/useKLiveRegion'; import { LearnerDeviceStatus } from 'kolibri.coreVue.vuex.constants'; import urls from 'kolibri.urls'; import redirectBrowser from 'kolibri.utils.redirectBrowser'; @@ -93,6 +94,8 @@ lastDownloadRemoved, } = useUserSyncStatus(); + const { sendAssertiveMessage } = useKLiveRegion(); + return { lastSynced, status, @@ -105,6 +108,7 @@ local_storage_lastDownloadRemoved, setLastSyncedValue, setDownloadRemovedValue, + sendAssertiveMessage, }; }, data() { @@ -114,6 +118,19 @@ }, computed: { ...mapGetters(['isLearner', 'isAdmin', 'canManageContent']), + message() { + let message = ''; + if (this.isAdmin) { + message = this.$tr('superAdminMessage'); + } else if (this.insufficientStorageNoDownloads) { + message = this.$tr('insufficientStorageNoDownloads'); + } else if (this.learnOnlyRemovedResources) { + message = this.$tr('resourcesRemoved'); + } else if (this.availableDownload) { + message = this.$tr('insufficientStorageAvailableDownloads'); + } + return message; + }, insufficientStorageNoDownloads() { return ( (this.isLearner && this.insufficientStorage) || @@ -144,6 +161,15 @@ } }, deep: true, + immediate: true, + }, + message: { + handler(newVal, oldVal) { + if (newVal !== oldVal) { + this.sendAssertiveMessage(this.message); + } + }, + immediate: true, }, }, mounted() { @@ -153,19 +179,6 @@ document.removeEventListener('focusin', this.focusChange); }, methods: { - getMessage() { - let message = ''; - if (this.isAdmin) { - message = this.$tr('superAdminMessage'); - } else if (this.insufficientStorageNoDownloads) { - message = this.$tr('insufficientStorageNoDownloads'); - } else if (this.learnOnlyRemovedResources) { - message = this.$tr('resourcesRemoved'); - } else if (this.availableDownload) { - message = this.$tr('insufficientStorageAvailableDownloads'); - } - return message; - }, closeBanner() { this.setLastSyncedValue(this.lastSynced); this.setDownloadRemovedValue(this.lastDownloadRemoved); diff --git a/packages/kolibri-core-for-export/package.json b/packages/kolibri-core-for-export/package.json index 661ac1cd0cd..e9765a66252 100644 --- a/packages/kolibri-core-for-export/package.json +++ b/packages/kolibri-core-for-export/package.json @@ -24,7 +24,7 @@ "js-cookie": "^3.0.5", "knuth-shuffle-seeded": "^1.0.6", "kolibri-constants": "0.2.6", - "kolibri-design-system": "4.4.0", + "kolibri-design-system": "5.0.0-rc1", "lockr": "0.8.5", "lodash": "^4.17.21", "loglevel": "^1.9.1", diff --git a/yarn.lock b/yarn.lock index 14771b89540..3d3a8c62fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2972,15 +2972,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -"aphrodite@git+https://github.com/learningequality/aphrodite.git": - version "2.2.3" - uid fdc8d7be8912a5cf17f74ff10f124013c52c3e32 - resolved "git+https://github.com/learningequality/aphrodite.git#fdc8d7be8912a5cf17f74ff10f124013c52c3e32" - dependencies: - asap "^2.0.3" - inline-style-prefixer "^4.0.2" - string-hash "^1.1.3" - "aphrodite@https://github.com/learningequality/aphrodite/": version "2.2.3" resolved "https://github.com/learningequality/aphrodite/#fdc8d7be8912a5cf17f74ff10f124013c52c3e32" @@ -7668,10 +7659,10 @@ kolibri-constants@0.2.6: resolved "https://registry.yarnpkg.com/kolibri-constants/-/kolibri-constants-0.2.6.tgz#d13762862505a3a6ec58a104870b21da96778656" integrity sha512-gQaY2wFNFrsB+9+xQNeEcLHixNuZEK+GHyKKr78s/hg8gFU3YVsnhlYp0u+du4XeVwewpyN1ajGb4UrrdF8rTA== -kolibri-design-system@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/kolibri-design-system/-/kolibri-design-system-4.4.0.tgz#4c230a701beafa9c87dc155b81e68128b02a4bfe" - integrity sha512-2oYNVkmY1NcXc3mNJVcphfT/glqQEriq72r0LEN3ILpGOitS99x/sGyHNOQmmww9h8/m4KBAAlD0D8IyE1xd0A== +kolibri-design-system@5.0.0-rc1: + version "5.0.0-rc1" + resolved "https://registry.yarnpkg.com/kolibri-design-system/-/kolibri-design-system-5.0.0-rc1.tgz#4d9ba7e24c3c96462479a500c5fd2df95c9ecc3f" + integrity sha512-W9OFtSDZNV0invXAW0he8dlj+m68BTjpsHXLQcO7GIwOpn0GZ5wjcPNGhQqCejLC0TefLCHPKNYiZFx+GIPCqw== dependencies: "@vue/composition-api" "1.7.2" aphrodite "https://github.com/learningequality/aphrodite/"