Merge tag '0.21.8' into develop

release 0.21.8
This commit is contained in:
vnmedeiros 2024-07-29 17:29:41 -03:00
commit 4e603a15dc
18 changed files with 1573 additions and 807 deletions

2222
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,10 +8,10 @@
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.prod.js --progress --mode production" "build-prod": "cross-env NODE_ENV=production webpack --config webpack.prod.js --progress --mode production"
}, },
"dependencies": { "dependencies": {
"@ntohq/buefy-next": "^0.1.3", "@ntohq/buefy-next": "^0.1.4",
"@vue-leaflet/vue-leaflet": "^0.10.1", "@vue-leaflet/vue-leaflet": "^0.10.1",
"another-vue3-blurhash": "^0.0.1", "another-vue3-blurhash": "^0.0.1",
"apexcharts": "^3.49.1", "apexcharts": "^3.51.0",
"axios": "^1.6.8", "axios": "^1.6.8",
"blurhash": "^2.0.5", "blurhash": "^2.0.5",
"bulma": "^0.9.4", "bulma": "^0.9.4",
@ -26,37 +26,37 @@
"moment": "^2.30.1", "moment": "^2.30.1",
"node-sass": "^8.0.0", "node-sass": "^8.0.0",
"photoswipe": "^5.4.4", "photoswipe": "^5.4.4",
"qs": "^6.12.1", "qs": "^6.12.3",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"sortablejs": "^1.15.2", "sortablejs": "^1.15.2",
"sortablejs-vue3": "^1.2.11", "sortablejs-vue3": "^1.2.11",
"swiper": "^11.1.3", "swiper": "^11.1.8",
"vue": "^3.4.27", "vue": "^3.4.34",
"vue-countup-v3": "^1.4.2", "vue-countup-v3": "^1.4.2",
"vue-imask": "^7.6.1", "vue-imask": "^7.6.1",
"vue-router": "^4.3.2", "vue-router": "^4.4.0",
"vue3-apexcharts": "^1.5.3", "vue3-apexcharts": "^1.5.3",
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.24.3", "@babel/core": "^7.24.9",
"@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.24.3", "@babel/preset-env": "^7.25.0",
"@babel/preset-react": "^7.24.1", "@babel/preset-react": "^7.24.7",
"@types/leaflet": "^1.9.8", "@types/leaflet": "^1.9.12",
"@types/masonry-layout": "^4.2.7", "@types/masonry-layout": "^4.2.8",
"@vue/compiler-sfc": "3.4.21", "@vue/compiler-sfc": "3.4.34",
"acorn": "^8.11.3", "acorn": "^8.12.1",
"ajv": "^8.12.0", "ajv": "^8.17.1",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"circular-dependency-plugin": "5.2.2", "circular-dependency-plugin": "5.2.2",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^6.10.0", "css-loader": "^6.10.0",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-plugin-vue": "^9.24.0", "eslint-plugin-vue": "^9.27.0",
"eslint-webpack-plugin": "^4.1.0", "eslint-webpack-plugin": "^4.2.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"moment-locales-webpack-plugin": "^1.2.0", "moment-locales-webpack-plugin": "^1.2.0",
"postcss-loader": "8.1.1", "postcss-loader": "8.1.1",
@ -64,8 +64,8 @@
"style-loader": "^3.3.4", "style-loader": "^3.3.4",
"terser-webpack-plugin": "5.3.10", "terser-webpack-plugin": "5.3.10",
"vue-loader": "^17.4.2", "vue-loader": "^17.4.2",
"webpack": "^5.91.0", "webpack": "^5.93.0",
"webpack-bundle-analyzer": "^4.10.1", "webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1", "webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0" "webpack-merge": "^5.10.0"

View File

@ -9,7 +9,7 @@
border: 0; } border: 0; }
/** /**
* Swiper 11.1.3 * Swiper 11.1.8
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -17,7 +17,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: May 13, 2024 * Released on: July 26, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
border: 0; } border: 0; }
/** /**
* Swiper 11.1.3 * Swiper 11.1.8
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -17,7 +17,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: May 13, 2024 * Released on: July 26, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
border: 0; } border: 0; }
/** /**
* Swiper 11.1.3 * Swiper 11.1.8
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -17,7 +17,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: May 13, 2024 * Released on: July 26, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/** /**
* Swiper 11.1.3 * Swiper 11.1.8
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -7,7 +7,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: May 13, 2024 * Released on: July 26, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

File diff suppressed because one or more lines are too long

View File

@ -476,7 +476,8 @@ class Item_Metadata_Entity extends Entity {
if ($this->is_required()) { if ($this->is_required()) {
$validation_statuses = ['publish', 'future', 'private']; $validation_statuses = ['publish', 'future', 'private'];
if (in_array($item->get_status(), apply_filters( 'tainacan-status-require-validation', $validation_statuses) )) { if (in_array($item->get_status(), apply_filters( 'tainacan-status-require-validation', $validation_statuses) )) {
$this->add_error('required', $metadatum->get_name() . ' is required'); // translators: %s = metadatum name. ex: Title is required
$this->add_error( 'required', sprintf( __('%s is required', 'tainacan'), $metadatum->get_name() ) );
return false; return false;
} else { } else {
return $this->set_as_valid(); return $this->set_as_valid();

View File

@ -520,11 +520,12 @@ class Migrations {
\deactivate_plugins( 'tainacan-url-metadata-type/tainacan-metadata-type-url.php' ); \deactivate_plugins( 'tainacan-url-metadata-type/tainacan-metadata-type-url.php' );
} }
static function alter_table_tnc_bg_process_add_uuid() { static function alter_table_tnc_bg_process_add_uuid_refactor() {
global $wpdb; global $wpdb;
// update default order by "creation_date" to "date" // update default order by "creation_date" to "date"
$table_name = $wpdb->prefix . 'tnc_bg_process'; $table_name = $wpdb->prefix . 'tnc_bg_process';
$column_exists = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '$table_name' AND column_name = 'bg_uuid'" ); $database_name = DB_NAME;
$column_exists = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '$table_name' AND column_name = 'bg_uuid' AND table_schema = '$database_name'" );
if(empty($column_exists)) { if(empty($column_exists)) {
$wpdb->query(" $wpdb->query("

View File

@ -2,9 +2,9 @@
Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, vnmedeiros, tainacan, suelanesilva, ccaio, alanargomes, ateneagarcia123, rodrigo0freire, clarandreozzi Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, vnmedeiros, tainacan, suelanesilva, ccaio, alanargomes, ateneagarcia123, rodrigo0freire, clarandreozzi
Tags: museums, archives, GLAM, collections, repository Tags: museums, archives, GLAM, collections, repository
Requires at least: 5.9 Requires at least: 5.9
Tested up to: 6.5 Tested up to: 6.6
Requires PHP: 7.0 Requires PHP: 7.0
Stable tag: 0.21.7 Stable tag: 0.21.8
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html

View File

@ -5,17 +5,17 @@ Plugin URI: https://tainacan.org/
Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform. Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform.
Author: Tainacan.org Author: Tainacan.org
Author URI: https://tainacan.org/ Author URI: https://tainacan.org/
Version: 0.21.7 Version: 0.21.8
Requires at least: 5.9 Requires at least: 5.9
Tested up to: 6.5 Tested up to: 6.6
Requires PHP: 7.0 Requires PHP: 7.0
Stable tag: 0.21.7 Stable tag: 0.21.8
Text Domain: tainacan Text Domain: tainacan
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/ */
const TAINACAN_VERSION = '0.21.7'; const TAINACAN_VERSION = '0.21.8';
defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
$TAINACAN_BASE_URL = plugins_url('', __FILE__); $TAINACAN_BASE_URL = plugins_url('', __FILE__);

View File

@ -1661,7 +1661,7 @@ export default {
'my-attachment-media-frame', { 'my-attachment-media-frame', {
button_labels: { button_labels: {
frame_title: this.$i18n.get('instruction_select_files_to_attach_to_item'), frame_title: this.$i18n.get('instruction_select_files_to_attach_to_item'),
frame_button: this.$i18n.get('label_attach_to_item'), frame_button: this.$i18n.get('finish'),
}, },
nonce: this.item.nonces ? this.item.nonces['update-post_' + this.item.id] : null, nonce: this.item.nonces ? this.item.nonces['update-post_' + this.item.id] : null,
relatedPostId: this.itemId, relatedPostId: this.itemId,

View File

@ -51,7 +51,9 @@
<template <template
v-for="(taxonomyFilter, key, index) of taxonomyFilters" v-for="(taxonomyFilter, key, index) of taxonomyFilters"
:key="index"> :key="index">
<div v-if="key == 'repository-filters'"> <div
v-if="key == 'repository-filters'"
class="repository-level-filters">
<div <div
v-if="taxonomyFilter.length > 0 && taxonomyFiltersCollectionNames != undefined && taxonomyFiltersCollectionNames[key] != undefined" v-if="taxonomyFilter.length > 0 && taxonomyFiltersCollectionNames != undefined && taxonomyFiltersCollectionNames[key] != undefined"
v-tooltip="{ v-tooltip="{
@ -95,7 +97,10 @@
<template <template
v-for="(taxonomyFilter, key, index) of taxonomyFilters" v-for="(taxonomyFilter, key, index) of taxonomyFilters"
:key="index"> :key="index">
<div v-if="key != 'repository-filters'"> <div
v-if="key != 'repository-filters'"
:id="'filters-from-collection-id-' + key"
class="collection-level-filters">
<div <div
v-if="taxonomyFilter.length > 0 && taxonomyFiltersCollectionNames != undefined && taxonomyFiltersCollectionNames[key] != undefined" v-if="taxonomyFilter.length > 0 && taxonomyFiltersCollectionNames != undefined && taxonomyFiltersCollectionNames[key] != undefined"
v-tooltip="{ v-tooltip="{
@ -143,7 +148,9 @@
<template <template
v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters" v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters"
:key="index"> :key="index">
<div v-if="key == 'repository-filters'"> <div
v-if="key == 'repository-filters'"
class="repository-level-filters">
<div <div
v-if="repositoryCollectionFilter.length > 0 && repositoryCollectionNames != undefined && repositoryCollectionNames[key] != undefined" v-if="repositoryCollectionFilter.length > 0 && repositoryCollectionNames != undefined && repositoryCollectionNames[key] != undefined"
v-tooltip="{ v-tooltip="{
@ -187,7 +194,10 @@
<template <template
v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters" v-for="(repositoryCollectionFilter, key, index) of repositoryCollectionFilters"
:key="index"> :key="index">
<div v-if="key != 'repository-filters'"> <div
v-if="key != 'repository-filters'"
:id="'filters-from-collection-id-' + key"
class="collection-level-filters">
<div <div
v-if="repositoryCollectionFilter.length > 0 && repositoryCollectionNames != undefined && repositoryCollectionNames[key] != undefined" v-if="repositoryCollectionFilter.length > 0 && repositoryCollectionNames != undefined && repositoryCollectionNames[key] != undefined"
v-tooltip="{ v-tooltip="{

View File

@ -426,8 +426,15 @@ StatusHelperPlugin.install = function (app, options = {}) {
}); });
this.statuses.push({ this.statuses.push({
name: tainacan_plugin.i18n['status_trash'], name: tainacan_plugin.i18n['status_trash'],
slug: 'trash'} slug: 'trash'
); });
/**
* Filter the available status in Tainacan admin.
*
* @param array Array of objects containing slug and name of each status.
*/
this.statuses = wp.hooks.applyFilters('tainacan_admin_available_statuses', JSON.parse(JSON.stringify(this.statuses)));
}) })
.catch(error => { .catch(error => {
console.error( error ); console.error( error );

View File

@ -2,45 +2,6 @@ export default {
// AttachmentControl: requires upload of new files and accepts multiple files // AttachmentControl: requires upload of new files and accepts multiple files
attachmentControl: wp.customize.MediaControl.extend({ attachmentControl: wp.customize.MediaControl.extend({
/**
* Set up gallery toolbar.
*
* @return {void}
*/
galleryToolbar() {
this.toolbar.set(
new wp.media.view.Toolbar( {
controller: this,
items: {
insert: {
style: 'primary',
text: wp.media.view.l10n.update,
priority: 80,
requires: { library: true },
/**
* @fires wp.media.controller.State#select
*/
click() {
const controller = this.controller,
state = controller.state();
controller.close();
state.trigger(
'select',
state.get( 'library' )
);
// Restore and reset the default state.
controller.setState( controller.options.state );
controller.reset();
},
},
},
} )
);
},
/** /**
* Create a media modal select frame, and store it so the instance can be reused when needed. * Create a media modal select frame, and store it so the instance can be reused when needed.
*/ */
@ -54,6 +15,9 @@ export default {
wp.media.model.settings.post.id = parseInt(this.params.relatedPostId); wp.media.model.settings.post.id = parseInt(this.params.relatedPostId);
this.frame = wp.media({ this.frame = wp.media({
button: {
text: this.params.button_labels.frame_button
},
states: [ states: [
new wp.media.controller.Library({ new wp.media.controller.Library({
title: this.params.button_labels.frame_title, title: this.params.button_labels.frame_title,
@ -64,7 +28,6 @@ export default {
posts_per_page: -1, posts_per_page: -1,
query: true query: true
}), }),
toolbar: 'main-gallery',
autoSelect: true, autoSelect: true,
sortable: true, sortable: true,
filterable: 'unattached', filterable: 'unattached',
@ -72,8 +35,6 @@ export default {
] ]
}).open(); }).open();
this.frame.on( 'toolbar:create:main-gallery', this.galleryToolbar, this.frame );
this.frame.$el.addClass( 'tainacan-item-attachments-modal' ); this.frame.$el.addClass( 'tainacan-item-attachments-modal' );
this.frame.$el['tainacan-document-id'] = this.params.document; this.frame.$el['tainacan-document-id'] = this.params.document;
this.frame.$el['tainacan-thumbnail-id'] = this.params.thumbnailId; this.frame.$el['tainacan-thumbnail-id'] = this.params.thumbnailId;