From 70ae22e55a605b6b68020ec22b74d65a009419fc Mon Sep 17 00:00:00 2001 From: Liana Harris <46411498+LianaHarris360@users.noreply.github.com> Date: Mon, 21 Nov 2022 16:40:20 -0600 Subject: [PATCH] Some minor frontend issues fixed --- .../src/views/DeviceSettingsPage/index.vue | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/kolibri/plugins/device/assets/src/views/DeviceSettingsPage/index.vue b/kolibri/plugins/device/assets/src/views/DeviceSettingsPage/index.vue index 04773cd3986..d6ef30a096b 100644 --- a/kolibri/plugins/device/assets/src/views/DeviceSettingsPage/index.vue +++ b/kolibri/plugins/device/assets/src/views/DeviceSettingsPage/index.vue @@ -131,13 +131,15 @@

{{ primaryStorageLocation }} - - - + />

{{ $tr('secondaryStorage') }} -

+

{{ $tr('secondaryStorageDescription') }}

@@ -195,7 +197,10 @@ :description="$tr('setStorageLimitDescription')" @change="setLimitForAutodownload = $event" /> -

+
@@ -358,7 +365,7 @@ enableAutomaticDownload: null, allowLearnerDownloadResources: null, setLimitForAutodownload: null, - limitForAutodownload: 0, + limitForAutodownload: '0', freeSpace: 0, deviceUrls: [], showChangePrimaryLocationModal: false, @@ -371,6 +378,8 @@ restartPath: {}, restartSetting: null, showRestartModal: false, + writablePaths: 0, + readOnlyPaths: 0, }; }, computed: { @@ -412,6 +421,18 @@ notEnoughFreeSpace() { return this.freeSpace === 0; }, + multipleWritablePaths() { + Object.values(this.storageLocations).forEach(el => { + if (el.writable === true) this.writablePaths += 1; + }); + return this.writablePaths >= 2; + }, + multipleReadOnlyPaths() { + Object.values(this.storageLocations).forEach(el => { + if (el.writable === false) this.readOnlyPaths += 1; + }); + return this.readOnlyPaths >= 1; + }, sliderStyle() { if (this.notEnoughFreeSpace) { return { @@ -515,7 +536,7 @@ } this.allowLearnerDownloadResources = allow_learner_download_resources; this.enableAutomaticDownload = enable_automatic_download; - this.limitForAutodownload = limit_for_autodownload; + this.limitForAutodownload = limit_for_autodownload.toString(); this.setLimitForAutodownload = set_limit_for_autodownload; }, getContentSettings() { @@ -701,13 +722,6 @@ } return ''; }, - multipleReadOnlyPaths() { - if (this.storageLocations.filter(el => el.writeable).length === 0) { - return true; - } else { - return false; - } - }, }, $trs: { browserDefaultLanguage: { @@ -976,4 +990,9 @@ color: #686868; } + .disabled { + color: #e0e0e0 !important; + pointer-events: none; + } +