From 239a3f69825b4f3df66b78866f27753c4c8303ce Mon Sep 17 00:00:00 2001
From: Liana Harris <46411498+LianaHarris360@users.noreply.github.com>
Date: Thu, 12 Sep 2024 14:52:07 -0500
Subject: [PATCH] Revert "Update how About License information is displayed in
EditSourceModal"
---
.../QuickEditModal/EditSourceModal.vue | 2 +
.../__tests__/EditSourceModal.spec.js | 5 ++
.../channelEdit/components/edit/EditModal.vue | 6 ++
.../frontend/channelEdit/getters.js | 4 +
.../frontend/channelEdit/mutations.js | 4 +
.../frontend/channelEdit/store.js | 2 +
.../views/TreeView/TreeViewBase.vue | 6 ++
.../shared/views/AboutLicensesModal.vue | 62 +++++++++++++++
.../frontend/shared/views/LicenseDropdown.vue | 75 +++++--------------
9 files changed, 111 insertions(+), 55 deletions(-)
create mode 100644 contentcuration/contentcuration/frontend/shared/views/AboutLicensesModal.vue
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 @@
+
+
+
+
+
+ {{ license.name }}
+
+
+ {{ license.description }}
+
+
+
+
+
+
+
+
+
+
\ 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 @@