From 7bb08d1a1d7da085d093443ae88916a2184d54dd Mon Sep 17 00:00:00 2001 From: MisRob Date: Mon, 22 Jan 2024 09:14:48 +0100 Subject: [PATCH 1/3] Upgrade Studio to KDS 3.0.0 (1/3) Installs the dependency --- package.json | 2 +- yarn.lock | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index eab3e09dca..4a7e05875e 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "jspdf": "https://github.com/parallax/jsPDF.git#b7a1d8239c596292ce86dafa77f05987bcfa2e6e", "jszip": "^3.10.1", "kolibri-constants": "^0.2.0", - "kolibri-design-system": "https://github.com/learningequality/kolibri-design-system#e9a2ff34716bb6412fe99f835ded5b17345bab94", + "kolibri-design-system": "https://github.com/learningequality/kolibri-design-system#v3.0.0", "lodash": "^4.17.21", "material-icons": "0.3.1", "mutex-js": "^1.1.5", diff --git a/yarn.lock b/yarn.lock index ac2ce79212..af96be5853 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3083,6 +3083,11 @@ optionalDependencies: prettier "^1.18.2 || ^2.0.0" +"@vue/composition-api@^1.7.2": + version "1.7.2" + resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-1.7.2.tgz#0b656f3ec39fefc2cf40aaa8c12426bcfeae1b44" + integrity sha512-M8jm9J/laYrYT02665HkZ5l2fWTK4dcVg3BsDHm/pfz+MjDYwX+9FUaZyGwEyXEDonQYRCo0H7aLgdklcIELjw== + "@vue/test-utils@1.0.0-beta.29": version "1.0.0-beta.29" resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.29.tgz#c942cf25e891cf081b6a03332b4ae1ef430726f0" @@ -5125,6 +5130,11 @@ data-urls@^3.0.2: whatwg-mimetype "^3.0.0" whatwg-url "^11.0.0" +date-fns@^1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" + integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== + de-indent@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" @@ -9106,13 +9116,15 @@ kolibri-constants@^0.2.0: resolved "https://registry.yarnpkg.com/kolibri-constants/-/kolibri-constants-0.2.0.tgz#47c9d773894e23251ba5ac4db420822e45603142" integrity sha512-WYDMGDzB9gNxRbpX1O2cGe1HrJvLvSZGwMuAv6dqrxJgPf7iO+Hi40/1CXjHM7nk5CRt+hn5bqnMzCBmj1omPA== -"kolibri-design-system@https://github.com/learningequality/kolibri-design-system#e9a2ff34716bb6412fe99f835ded5b17345bab94": +"kolibri-design-system@https://github.com/learningequality/kolibri-design-system#v3.0.0": version "1.3.0" - resolved "https://github.com/learningequality/kolibri-design-system#e9a2ff34716bb6412fe99f835ded5b17345bab94" + resolved "https://github.com/learningequality/kolibri-design-system#24a7dfef611f7daf1432bbb9e0f569a0f9821844" dependencies: + "@vue/composition-api" "^1.7.2" aphrodite "https://github.com/learningequality/aphrodite/" autosize "^3.0.21" css-element-queries "^1.2.0" + date-fns "^1.30.1" frame-throttle "^3.0.0" fuzzysearch "^1.0.3" keen-ui "^1.3.0" @@ -9120,6 +9132,8 @@ kolibri-constants@^0.2.0: popper.js "^1.14.6" purecss "^0.6.2" tippy.js "^4.2.1" + vue-intl "^3.1.0" + xstate "^4.38.3" kolibri-tools@0.16.0-dev.3: version "0.16.0-dev.3" @@ -13474,7 +13488,7 @@ vue-hot-reload-api@^2.3.0: resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz#532955cc1eb208a3d990b3a9f9a70574657e08f2" integrity sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog== -vue-intl@^3.0.0: +vue-intl@^3.0.0, vue-intl@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/vue-intl/-/vue-intl-3.1.0.tgz#707f1f7406595c9b4afc6049254b333093be37be" integrity sha512-0v3S5gspuYnt6j1G+KLfPUsNnjRdbMOcYrWYoSd1gYk6rX8VuOyh7NLztPrSIJt+NLs/qzLOZXxI1LORukEiqA== @@ -14177,6 +14191,11 @@ xmldom@^0.1.22: resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.31.tgz#b76c9a1bd9f0a9737e5a72dc37231cf38375e2ff" integrity sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ== +xstate@^4.38.3: + version "4.38.3" + resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.38.3.tgz#4e15e7ad3aa0ca1eea2010548a5379966d8f1075" + integrity sha512-SH7nAaaPQx57dx6qvfcIgqKRXIh4L0A1iYEqim4s1u7c9VoCgzZc+63FY90AKU4ZzOC2cfJzTnpO4zK7fCUzzw== + xtend@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" From a4303ed499bc08ee22f767ba0fdee66fcca5f682 Mon Sep 17 00:00:00 2001 From: MisRob Date: Mon, 22 Jan 2024 09:37:09 +0100 Subject: [PATCH 2/3] Upgrade Studio to KDS 3.0.0 (2/3) Fixes "Error: Can't resolve 'kolibri-design-system/lib/utils/i18n'" caused by removal of this file in KDS v2.0.0 by copying the removed file content directly to Studio. --- .../frontend/shared/i18n/index.js | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/contentcuration/contentcuration/frontend/shared/i18n/index.js b/contentcuration/contentcuration/frontend/shared/i18n/index.js index 249b5ac561..13bcd01fd1 100644 --- a/contentcuration/contentcuration/frontend/shared/i18n/index.js +++ b/contentcuration/contentcuration/frontend/shared/i18n/index.js @@ -1,15 +1,25 @@ import Vue from 'vue'; import has from 'lodash/has'; -import { languageDirections, defaultLanguage } from 'kolibri-design-system/lib/utils/i18n'; import importVueIntlLocaleData from './vue-intl-locale-data'; import importIntlLocale from './intl-locale-data'; -export { - languageDirections, - defaultLanguage, - languageValidator, - getContentLangDir, -} from 'kolibri-design-system/lib/utils/i18n'; +const languageDirections = { + LTR: 'ltr', + RTL: 'rtl', +}; +const defaultLanguage = { + id: 'en', + lang_name: 'English', + lang_direction: languageDirections.LTR, +}; +const languageValidator = language => { + return ['id', 'lang_name', 'lang_direction'].reduce((valid, key) => valid && language[key], true); +}; +const getContentLangDir = language => { + return (language || {}).lang_direction || languageDirections.LTR; +}; + +export { languageDirections, defaultLanguage, languageValidator, getContentLangDir }; let _i18nReady = false; From 0311c02e64fd1560ce9f764819deee3628009ab8 Mon Sep 17 00:00:00 2001 From: MisRob Date: Mon, 22 Jan 2024 11:38:00 +0100 Subject: [PATCH 3/3] Upgrade Studio to KDS 3.0.0 (3/3) Remove deprecated `value` prop in favor of the new `buttonValue` prop that's supposed to replace it in `KRadioButton`. --- .../frontend/settings/pages/Storage/RequestForm.vue | 6 +++--- .../shared/languageSwitcher/LanguageSwitcherModal.vue | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contentcuration/contentcuration/frontend/settings/pages/Storage/RequestForm.vue b/contentcuration/contentcuration/frontend/settings/pages/Storage/RequestForm.vue index faa01aac37..aaed431916 100644 --- a/contentcuration/contentcuration/frontend/settings/pages/Storage/RequestForm.vue +++ b/contentcuration/contentcuration/frontend/settings/pages/Storage/RequestForm.vue @@ -142,7 +142,7 @@ v-for="affiliation in affiliationOptions" :key="affiliation.value" v-model="org_or_personal" - :value="affiliation.value" + :buttonValue="affiliation.value" :invalid="errors.org_or_personal" :showInvalidText="errors.org_or_personal" :invalidText="$tr('fieldRequiredText')" @@ -172,7 +172,7 @@ v-for="orgType in organizationTypeOptions" :key="orgType.value" v-model="organization_type" - :value="orgType.value" + :buttonValue="orgType.value" :invalid="errors.organization_type" :showInvalidText="errors.organization_type" :invalidText="$tr('fieldRequiredText')" @@ -199,7 +199,7 @@ v-for="constraint in timeConstraintOptions" :key="constraint.value" v-model="time_constraint" - :value="constraint.value" + :buttonValue="constraint.value" :label="constraint.text" /> diff --git a/contentcuration/contentcuration/frontend/shared/languageSwitcher/LanguageSwitcherModal.vue b/contentcuration/contentcuration/frontend/shared/languageSwitcher/LanguageSwitcherModal.vue index 9eb3c03362..d3c8cfe83b 100644 --- a/contentcuration/contentcuration/frontend/shared/languageSwitcher/LanguageSwitcherModal.vue +++ b/contentcuration/contentcuration/frontend/shared/languageSwitcher/LanguageSwitcherModal.vue @@ -19,7 +19,7 @@ v-for="language in languageCol" :key="language.id" v-model="selectedLanguage" - :value="language.id" + :buttonValue="language.id" :label="language.lang_name" :title="language.english_name" class="language-name"