diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditSourceModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditSourceModal.vue index 839f19a896..523bd1ad11 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditSourceModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/QuickEditModal/EditSourceModal.vue @@ -2,6 +2,7 @@
{ generalActions = { showSnackbarSimple: jest.fn(), }; + generalGetters = { + isAboutLicensesModalOpen: () => false, + }; store = new Vuex.Store({ actions: generalActions, + getters: generalGetters, modules: { contentNode: { namespaced: true, diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue b/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue index 2dba69cc0f..655b8fb6e1 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue @@ -122,6 +122,9 @@ + + !state.connection.online, }), + ...mapGetters(['isAboutLicensesModalOpen']), ...mapGetters('contentNode', ['getContentNode']), ...mapGetters('currentChannel', ['currentChannel', 'canEdit', 'canManage', 'rootId']), rootNode() { diff --git a/contentcuration/contentcuration/frontend/shared/views/AboutLicensesModal.vue b/contentcuration/contentcuration/frontend/shared/views/AboutLicensesModal.vue new file mode 100644 index 0000000000..2c11725383 --- /dev/null +++ b/contentcuration/contentcuration/frontend/shared/views/AboutLicensesModal.vue @@ -0,0 +1,62 @@ + + + \ No newline at end of file diff --git a/contentcuration/contentcuration/frontend/shared/views/LicenseDropdown.vue b/contentcuration/contentcuration/frontend/shared/views/LicenseDropdown.vue index d389579654..64b9ac92d8 100644 --- a/contentcuration/contentcuration/frontend/shared/views/LicenseDropdown.vue +++ b/contentcuration/contentcuration/frontend/shared/views/LicenseDropdown.vue @@ -23,38 +23,19 @@ :class="{ 'with-trailing-input-icon': box }" :attach="attach" @focus="$emit('focus')" - /> + > + + -

- -

-
-

- {{ licenseItem.name }} -

-

- {{ licenseItem.description }} -

-

- -

-
- import RequestForm from '../../settings/pages/Storage/RequestForm.vue'; + import { mapMutations } from 'vuex'; import { getLicenseValidators, getLicenseDescriptionValidators, @@ -89,7 +70,6 @@ import { LicensesList } from 'shared/leUtils/Licenses'; import { constantsTranslationMixin } from 'shared/mixins'; import DropdownWrapper from 'shared/views/form/DropdownWrapper'; - import { crossComponentTranslator } from 'shared/i18n'; const MIXED_VALUE = 'mixed'; @@ -134,12 +114,6 @@ default: false, }, }, - data() { - return { - requestFormStrings: crossComponentTranslator(RequestForm), - showAboutLicense: false, - }; - }, computed: { license: { get() { @@ -204,29 +178,17 @@ ? getLicenseDescriptionValidators().map(translateValidator) : []; }, - licences() { - return LicensesList.filter(license => license.id).map(license => ({ - ...license, - name: this.translateConstant(license.license_name), - description: this.translateConstant(license.license_name + '_description'), - })); - }, }, methods: { + ...mapMutations({ + setShowAboutLicenses: 'SET_SHOW_ABOUT_LICENSES', + }), translate(item) { if (item.id === MIXED_VALUE) { return this.$tr('mixed'); } return (item.id && item.id !== '' && this.translateConstant(item.license_name)) || ''; }, - toggleAboutLicenseDisplay() { - this.showAboutLicense = !this.showAboutLicense; - }, - getLicenseUrl(license) { - const isCC = license.license_url.includes('creativecommons.org'); - const language = window.languageCode || 'en'; - return isCC ? `${license.license_url}deed.${language}` : license.license_url; - }, }, $trs: { mixed: 'Mixed', @@ -240,6 +202,10 @@