diff --git a/compile-sass.sh b/compile-sass.sh index 0ed850c2a..92369e83c 100644 --- a/compile-sass.sh +++ b/compile-sass.sh @@ -15,15 +15,21 @@ sass -E 'UTF-8' --cache-location .tmp/sass-cache-2 src/admin/scss/tainacan-admin sass -E 'UTF-8' --cache-location .tmp/sass-cache-3 src/gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss:src/assets/css/tainacan-gutenberg-block-collections-list.css -sass -E 'UTF-8' --cache-location .tmp/sass-cache-4 src/gutenberg-blocks/tainacan-items/items-list/items-list.scss:src/assets/css/tainacan-gutenberg-block-items-list.css +sass -E 'UTF-8' --cache-location .tmp/sass-cache-4 src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-collections-list.css -sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list.scss:src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css +sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/gutenberg-blocks/tainacan-items/items-list/items-list.scss:src/assets/css/tainacan-gutenberg-block-items-list.css -sass -E 'UTF-8' --cache-location .tmp/sass-cache-5 src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css +sass -E 'UTF-8' --cache-location .tmp/sass-cache-6 src/gutenberg-blocks/tainacan-items/dynamic-items-list/dynamic-items-list.scss:src/assets/css/tainacan-gutenberg-block-dynamic-items-list.css -sass -E 'UTF-8' --cache-location .tmp/sass-cache-6 src/gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css +sass -E 'UTF-8' --cache-location .tmp/sass-cache-7 src/gutenberg-blocks/tainacan-items/search-bar/search-bar.scss:src/assets/css/tainacan-gutenberg-block-search-bar.css -sass -E 'UTF-8' --cache-location .tmp/sass-cache-7 src/gutenberg-blocks/tainacan-facets/facets-list/facets-list.scss:src/assets/css/tainacan-gutenberg-block-facets-list.css +sass -E 'UTF-8' --cache-location .tmp/sass-cache-8 src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css + +sass -E 'UTF-8' --cache-location .tmp/sass-cache-9 src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list.scss:src/assets/css/tainacan-gutenberg-block-carousel-items-list.css + +sass -E 'UTF-8' --cache-location .tmp/sass-cache-10 src/gutenberg-blocks/tainacan-terms/terms-list/terms-list.scss:src/assets/css/tainacan-gutenberg-block-terms-list.css + +sass -E 'UTF-8' --cache-location .tmp/sass-cache-11 src/gutenberg-blocks/tainacan-facets/facets-list/facets-list.scss:src/assets/css/tainacan-gutenberg-block-facets-list.css echo "Compilação do Sass Concluído!" exit 0 diff --git a/deploy_rsa.enc b/deploy_rsa.enc deleted file mode 100644 index 79323ba06..000000000 Binary files a/deploy_rsa.enc and /dev/null differ diff --git a/package-lock.json b/package-lock.json index f17973976..128b22f63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,9 +76,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -97,9 +97,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -156,9 +156,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -235,9 +235,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -267,9 +267,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -370,9 +370,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -568,9 +568,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -936,9 +936,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -955,9 +955,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true } } @@ -1951,9 +1951,9 @@ } }, "buefy": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/buefy/-/buefy-0.7.10.tgz", - "integrity": "sha512-jU9CTEQR1rozxagwEPB69qObBDwWl+4uCa6TjiPkqcqOb/uxq1uvyvCsVinADzjNjzOTFhUOuuSPQk8gsVEOzA==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/buefy/-/buefy-0.8.3.tgz", + "integrity": "sha512-01aHoCy4LAD08MmUahXC8mVqtGK/kzJ45ysXskwLWILAhyLMqkZ5fvdMKD9Ky6iDsMttPHdwUe2csmdnIx9caw==", "requires": { "bulma": "0.7.5" } @@ -3177,9 +3177,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "ms": { @@ -3247,10 +3247,13 @@ } }, "eslint-utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", - "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", - "dev": true + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz", + "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.0.0" + } }, "eslint-visitor-keys": { "version": "1.0.0", @@ -4605,9 +4608,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" } } }, @@ -5107,9 +5110,9 @@ "dev": true }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "string-width": { @@ -5663,9 +5666,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "lodash.camelcase": { "version": "4.3.0", @@ -5680,9 +5683,9 @@ "dev": true }, "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lodash.tail": { "version": "4.1.1", @@ -5972,9 +5975,9 @@ } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -6218,9 +6221,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" } } }, @@ -7840,9 +7843,9 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -8470,9 +8473,9 @@ "dev": true }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "string-width": { @@ -8890,38 +8893,15 @@ "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "uniq": { @@ -9155,12 +9135,6 @@ "swiper": "^4.0.7" } }, - "vue-custom-element": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/vue-custom-element/-/vue-custom-element-3.2.6.tgz", - "integrity": "sha512-tNWsax/Rq4Sr1QHj0pi4CWaBnAYfva75rlQg2fBKGja35+6AmdcZre/ztoiBWCSlSJ7APsMakG5R0A+GWBAc4Q==", - "dev": true - }, "vue-eslint-parser": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz", @@ -9545,9 +9519,9 @@ "dev": true }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "supports-color": { @@ -9768,9 +9742,9 @@ "dev": true }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "mime": { diff --git a/package.json b/package.json index f46b76e1d..8ddcd0e23 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "axios": "^0.19.0", - "buefy": "^0.7.10", + "buefy": "^0.8.3", "bulma": "^0.7.5", "mdi": "^2.2.43", "moment": "^2.22.2", @@ -42,7 +42,6 @@ "sass-loader": "^7.1.0", "style-loader": "^0.23.1", "terser-webpack-plugin": "^1.1.0", - "vue-custom-element": "^3.2.6", "vue-loader": "^15.4.2", "vue-template-compiler": "^2.5.17", "webpack": "^4.22.0", diff --git a/src/admin/components/advanced-search/advanced-search.vue b/src/admin/components/advanced-search/advanced-search.vue index 76c22f74c..fda56ef69 100644 --- a/src/admin/components/advanced-search/advanced-search.vue +++ b/src/admin/components/advanced-search/advanced-search.vue @@ -233,22 +233,36 @@ } }, mounted(){ - this.$root.$on('metadatumUpdated', (isRepositoryLevel) => { - if(isRepositoryLevel) { - this.metadataIsLoading = true; + this.$root.$on('metadatumUpdated', (isRepositoryLevel) => { - this.fetchMetadata({ - collectionId: this.isRepositoryLevel ? false : this.collectionId, - isRepositoryLevel: this.isRepositoryLevel, - isContextEdit: false, - includeDisabled: false, - isAdvancedSearch: true - }).then((metadata) => { - this.metadata = metadata; - this.metadataIsLoading = false; - }); - } - }); + if (isRepositoryLevel) { + this.metadataIsLoading = true; + + // Cancels previous Request + if (this.metadataSearchCancel != undefined) + this.metadataSearchCancel.cancel('Metadata search Canceled.'); + + this.fetchMetadata({ + collectionId: this.isRepositoryLevel ? false : this.collectionId, + isRepositoryLevel: this.isRepositoryLevel, + isContextEdit: false, + includeDisabled: false, + isAdvancedSearch: true + }).then((resp) => { + resp.request + .then((metadata) => { + this.metadata = metadata; + this.metadataIsLoading = false; + }).catch(() => { + this.metadataIsLoading = false; + }); + + // Search Request Token for cancelling + this.metadataSearchCancel = resp.source; + }) + .catch(() => this.metadataIsLoading = false); + } + }); }, created(){ @@ -260,10 +274,19 @@ isContextEdit: false, includeDisabled: false, isAdvancedSearch: true - }).then((metadata) => { - this.metadata = metadata; - this.metadataIsLoading = false; - }); + }).then((resp) => { + resp.request + .then((metadata) => { + this.metadata = metadata; + this.metadataIsLoading = false; + }).catch(() => { + this.metadataIsLoading = false; + }); + + // Search Request Token for cancelling + this.metadataSearchCancel = resp.source; + }) + .catch(() => this.metadataIsLoading = false); if ((this.$route.query.metaquery && Object.keys(this.$route.query.metaquery).length > 0) || (this.$route.query.taxquery && Object.keys(this.$route.query.taxquery).length > 0) ){ @@ -344,6 +367,7 @@ }, metadataIsLoading: false, metadata: [], + metadataSearchCancel: undefined } }, methods: { @@ -558,6 +582,11 @@ }, beforeDestroy() { this.$root.$off('metadatumUpdated'); + + // Cancels previous Request + if (this.metadataSearchCancel != undefined) + this.metadataSearchCancel.cancel('Metadata search Canceled.'); + } } diff --git a/src/admin/components/bulk-edition/bulk-edition-modal.vue b/src/admin/components/bulk-edition/bulk-edition-modal.vue index 99415d1bf..fa3cdd9f9 100644 --- a/src/admin/components/bulk-edition/bulk-edition-modal.vue +++ b/src/admin/components/bulk-edition/bulk-edition-modal.vue @@ -320,20 +320,30 @@ collectionID: Number, }, created(){ - if(!this.collectionID){ - // is repository level - - } else { + if (this.collectionID){ this.metadataIsLoading = true; + // Cancels previous Request + if (this.metadataSearchCancel != undefined) + this.metadataSearchCancel.cancel('Metadata search Canceled.'); + this.fetchMetadata({ collectionId: this.collectionID, isRepositoryLevel: false, isContextEdit: true, - includeDisabled: false, - }).then(() => { - this.metadataIsLoading = false; - }); + includeDisabled: false + }).then((resp) => { + resp.request + .then(() => { + this.metadataIsLoading = false; + }).catch(() => { + this.metadataIsLoading = false; + }); + + // Search Request Token for cancelling + this.metadataSearchCancel = resp.source; + }) + .catch(() => this.metadataIsLoading = false); } this.createEditGroup({ @@ -378,6 +388,7 @@ groupID: null, dones: [false], metadataIsLoading: false, + metadataSearchCancel: undefined } }, methods: { @@ -552,6 +563,12 @@ } } }, + beforeDestroy() { + // Cancels previous Request + if (this.metadataSearchCancel != undefined) + this.metadataSearchCancel.cancel('Metadata search Canceled.'); + + } } diff --git a/src/admin/components/edition/collection-edition-form.vue b/src/admin/components/edition/collection-edition-form.vue index b1eb25caf..32f76842a 100644 --- a/src/admin/components/edition/collection-edition-form.vue +++ b/src/admin/components/edition/collection-edition-form.vue @@ -598,9 +598,6 @@ export default { 'fetchUsers', 'fetchCollectionsForParent' ]), - ...mapActions('metadata', [ - 'fetchMetadata' - ]), updateSlug: _.debounce(function() { if(!this.form.name || this.form.name.length <= 0){ return; @@ -928,14 +925,19 @@ export default { // Generates options for parent collection this.isFetchingCollections = true; this.fetchCollectionsForParent() - .then((collections) => { - this.collections = collections; - this.isFetchingCollections = false; - }) - .catch((error) => { - this.$console.error(error); - this.isFetchingCollections = false; - }); + .then((resp) => { + resp.request.then((collections) => { + this.collections = collections; + this.isFetchingCollections = false; + }) + .catch((error) => { + this.$console.error(error); + this.isFetchingCollections = false; + }); + }) + .catch(() => { + this.isFetchingCollections = false; + }); this.isLoading = false; }); @@ -957,7 +959,7 @@ export default { @import "../../scss/_variables.scss"; - @media screen and (max-width: 1024px) { + @media screen and (min-width: 1024px) { .column:last-of-type { padding-left: $page-side-padding !important; } diff --git a/src/admin/components/edition/importer-edition-form.vue b/src/admin/components/edition/importer-edition-form.vue index 3e70a0899..6fba81d86 100644 --- a/src/admin/components/edition/importer-edition-form.vue +++ b/src/admin/components/edition/importer-edition-form.vue @@ -387,14 +387,19 @@ export default { // Generates options for target collection this.isFetchingCollections = true; this.fetchCollectionsForParent() - .then((collections) => { - this.collections = collections; - this.isFetchingCollections = false; - }) - .catch((error) => { - this.$console.error(error); - this.isFetchingCollections = false; - }); + .then((resp) => { + resp.request.then((collections) => { + this.collections = collections; + this.isFetchingCollections = false; + }) + .catch((error) => { + this.$console.error(error); + this.isFetchingCollections = false; + }); + }) + .catch(() => { + this.isFetchingCollections = false; + }); }, onSelectCollection(collectionId) { this.collectionId = collectionId; diff --git a/src/admin/components/edition/importer-mapping-form.vue b/src/admin/components/edition/importer-mapping-form.vue index faf73b904..7cd03307e 100644 --- a/src/admin/components/edition/importer-mapping-form.vue +++ b/src/admin/components/edition/importer-mapping-form.vue @@ -41,18 +41,21 @@
-

{{ $i18n.get('label_from_source_collection') }}

-

{{ $i18n.get('label_to_target_collection') }}

+ importerSourceInfo != null && + !isLoading"> +

{{ source_metadatum }}

- + :key="index"> +

{{ source_metadatum }}

0 && + !isFetchingCollectionMetadata" :value="checkCurrentSelectedCollectionMetadatum(source_metadatum)" @input="onSelectCollectionMetadata($event, source_metadatum)" :placeholder="$i18n.get('label_select_metadatum')"> @@ -77,6 +80,16 @@

{{ $i18n.get('info_select_collection_to_list_metadata') }}

+
+

{{ specialField }}

+

{{ $i18n.get('info_special_fields_mapped_default') }}

+
+

{{ $i18n.get('info_no_metadata_source_file') }}

+

{{ $i18n.get('info_no_special_fields_available') }}

@@ -136,7 +149,7 @@
@@ -149,7 +162,6 @@ importerSourceInfo == null">

{{ $i18n.get('info_upload_a_source_to_see_metadata') }}

- @@ -207,7 +219,8 @@ export default { isEditingMetadatum: false, metadatum: {}, editedMetadatum: {}, - backgroundProcess: undefined + backgroundProcess: undefined, + metadataSearchCancel: undefined } }, components: { @@ -275,22 +288,37 @@ export default { loadMetadata() { // Generates options for metadata listing this.isFetchingCollectionMetadata = true; - this.fetchMetadata({collectionId: this.collectionId, isRepositoryLevel: false, isContextEdit: false }) - .then((metadata) => { - this.collectionMetadata = JSON.parse(JSON.stringify(metadata)); - this.isFetchingCollectionMetadata = false; - this.fetchMappingImporter({ collection: this.collectionId, sessionId: this.sessionId }) - .then(res => { - if( res ) { - this.mappedCollection['mapping'] = res; - } - }) - }) - .catch((error) => { - this.$console.error(error); - this.isFetchingCollectionMetadata = false; - }); + // Cancels previous Request + if (this.metadataSearchCancel != undefined) + this.metadataSearchCancel.cancel('Metadata search Canceled.'); + + this.fetchMetadata({ + collectionId: this.collectionId, + isRepositoryLevel: false, + isContextEdit: false + }).then((resp) => { + resp.request + .then((metadata) => { + this.collectionMetadata = JSON.parse(JSON.stringify(metadata)); + this.isFetchingCollectionMetadata = false; + + this.fetchMappingImporter({ collection: this.collectionId, sessionId: this.sessionId }) + .then(res => { + if( res ) { + this.mappedCollection['mapping'] = res; + } + }) + }) + .catch((error) => { + this.$console.error(error); + this.isFetchingCollectionMetadata = false; + }); + + // Search Request Token for cancelling + this.metadataSearchCancel = resp.source; + }) + .catch(() => this.isFetchingCollectionMetadata = false); }, cancelBack(){ this.$router.go(-2); @@ -433,6 +461,11 @@ export default { this.loadImporter(); this.loadMetadata(); + }, + beforeDestroy() { + // Cancels previous Request + if (this.metadataSearchCancel != undefined) + this.metadataSearchCancel.cancel('Metadata search Canceled.'); } } @@ -490,6 +523,13 @@ export default { position: relative; } + .tainacan-form { + display: flex; + flex-direction: column; + justify-content: space-between; + min-height: 247px; + } + .form-submit { margin-top: 24px; } diff --git a/src/admin/components/edition/item-bulk-edition-form.vue b/src/admin/components/edition/item-bulk-edition-form.vue index 97fac9c69..5f6b6f8cc 100644 --- a/src/admin/components/edition/item-bulk-edition-form.vue +++ b/src/admin/components/edition/item-bulk-edition-form.vue @@ -263,7 +263,7 @@ export default { this.uploadedItems.splice(index, 1); item.errorMessage = error.data.message; - this.$toast.open({ + this.$buefy.toast.open({ message: item.errorMessage + ": " + file.name, type: 'is-danger', position: 'is-bottom', @@ -321,7 +321,7 @@ export default { }); }, deleteOneItem(itemId, index) { - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { diff --git a/src/admin/components/edition/item-edition-form.vue b/src/admin/components/edition/item-edition-form.vue index 8a48e8965..5b990391e 100644 --- a/src/admin/components/edition/item-edition-form.vue +++ b/src/admin/components/edition/item-edition-form.vue @@ -509,14 +509,16 @@ style="margin-left: calc(4.666667% + 12px)" type="button" class="button is-secondary" - @click.prevent="attachmentMediaFrame.openFrame($event)"> + @click.prevent="attachmentMediaFrame.openFrame($event)" + :disabled="isLoadingAttachments"> {{ $i18n.get("label_edit_attachments") }} - @@ -753,6 +755,8 @@ export default { collectionAllowComments: '', entityName: 'item', activeTab: 0, + isLoadingAttachments: false, + collectionNameSearchCancel: undefined } }, computed: { @@ -819,6 +823,7 @@ export default { 'cleanMetadata', 'sendAttachments', 'fetchAttachments', + 'deletePermanentlyAttachment', 'updateThumbnail', 'cleanLastUpdated', 'setLastUpdated', @@ -850,9 +855,18 @@ export default { let previousStatus = this.form.status; this.form.status = status; - let data = {id: this.itemId, status: this.form.status, comment_status: this.form.comment_status}; + this.form.comment_status = this.form.comment_status == 'open' ? 'open' : 'closed'; + + let data = { id: this.itemId, status: this.form.status, comment_status: this.form.comment_status }; this.fillExtraFormData(data); - this.updateItem(data).then(updatedItem => { + + let promise = null; + if (status == 'trash') + promise = this.deleteItem({ itemId: this.itemId, isPermanently: false }); + else + promise = this.updateItem(data); + + promise.then(updatedItem => { this.item = updatedItem; @@ -860,7 +874,7 @@ export default { this.updateExtraFormData(this.item); // Fill this.form data with current data. - this.form.status = this.item.status; + this.form.status = status == 'trash' ? status : this.item.status; this.form.document = this.item.document; this.form.document_type = this.item.document_type; this.form.comment_status = this.item.comment_status; @@ -883,13 +897,15 @@ export default { } }) .catch((errors) => { - for (let error of errors.errors) { - for (let metadatum of Object.keys(error)){ - eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); + if (errors.errors) { + for (let error of errors.errors) { + for (let metadatum of Object.keys(error)){ + eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); + } + } - + this.formErrorMessage = errors.error_message; } - this.formErrorMessage = errors.error_message; this.form.status = previousStatus; this.item.status = previousStatus; @@ -910,6 +926,7 @@ export default { ]); // Creates draft Item + this.form.comment_status = this.form.comment_status == 'open' ? 'open' : 'closed'; let data = {collection_id: this.form.collectionId, status: 'auto-draft', comment_status: this.form.comment_status}; this.fillExtraFormData(data); this.sendItem(data).then(res => { @@ -927,8 +944,12 @@ export default { this.form.document_type = this.item.document_type; this.form.comment_status = this.item.comment_status; + // Loads metadata and attachments this.loadMetadata(); - this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId }); + this.isLoadingAttachments = true; + this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId }) + .then(() => this.isLoadingAttachments = false) + .catch(() => this.isLoadingAttachments = false); }) .catch(error => this.$console.error(error)); @@ -1007,7 +1028,7 @@ export default { .catch((errors) => { for (let error of errors.errors) { for (let metadatum of Object.keys(error)){ - eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); + eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); } } this.formErrorMessage = errors.error_message; @@ -1030,12 +1051,15 @@ export default { document_type: this.form.document_type }) .then(() => { - this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document }); + this.isLoadingAttachments = true; + this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document }) + .then(() => this.isLoadingAttachments = false) + .catch(() => this.isLoadingAttachments = false); }) .catch((errors) => { for (let error of errors.errors) { for (let metadatum of Object.keys(error)){ - eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); + eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); } } this.formErrorMessage = errors.error_message; @@ -1051,7 +1075,7 @@ export default { }); }, deleteAttachment(attachment) { - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { @@ -1059,9 +1083,13 @@ export default { title: this.$i18n.get('label_warning'), message: this.$i18n.get('info_warning_attachment_delete'), onConfirm: () => { - this.removeAttachmentFromItem(attachment.id) + this.deletePermanentlyAttachment(attachment.id) .then(() => { - this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document }); + this.isLoadingAttachments = true; + + this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document }) + .then(() => this.isLoadingAttachments = false) + .catch(() => this.isLoadingAttachments = false); }) .catch((error) => { this.$console.error(error); @@ -1097,7 +1125,7 @@ export default { .catch((errors) => { for (let error of errors.errors) { for (let metadatum of Object.keys(error)){ - eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); + eventBus.errors.push({ metadatum_id: metadatum, errors: error[metadatum]}); } } this.formErrorMessage = errors.error_message; @@ -1132,7 +1160,10 @@ export default { relatedPostId: this.itemId, onSave: () => { // Fetch current existing attachments - this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document }); + this.isLoadingAttachments = true; + this.fetchAttachments({ page: 1, attachmentsPerPage: 24, itemId: this.itemId, documentId: this.item.document }) + .then(() => this.isLoadingAttachments = false) + .catch(() => this.isLoadingAttachments = false); } } ); @@ -1149,7 +1180,7 @@ export default { this.metadataCollapses.splice(index, 1, event); }, onDeletePermanently() { - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { @@ -1287,9 +1318,21 @@ export default { // Obtains collection name if (!this.isRepositoryLevel) { - this.fetchCollectionName(this.collectionId).then((collectionName) => { - this.collectionName = collectionName; - }); + + // Cancels previous collection name Request + if (this.collectionNameSearchCancel != undefined) + this.collectionNameSearchCancel.cancel('Collection name search Canceled.'); + + this.fetchCollectionName(this.collectionId) + .then((resp) => { + resp.request + .then((collectionName) => { + this.collectionName = collectionName; + }); + + // Search Request Token for cancelling + this.collectionNameSearchCancel = resp.source; + }) } // Obtains if collection allow items comments @@ -1312,10 +1355,14 @@ export default { beforeDestroy () { eventBus.$off('isUpdatingValue'); eventBus.$off('hasErrorsOnForm'); + + // Cancels previous collection name Request + if (this.collectionNameSearchCancel != undefined) + this.collectionNameSearchCancel.cancel('Collection name search Canceled.'); }, beforeRouteLeave ( to, from, next ) { if (this.item.status == 'auto-draft') { - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { @@ -1410,8 +1457,13 @@ export default { padding-left: 0; padding-right: $page-side-padding; - .columns .column { - padding: 1rem $page-side-padding 0 24px; + .columns { + flex-wrap: wrap; + justify-content: space-between; + + .column { + padding: 1rem 12px 0 12px; + } } .field { diff --git a/src/admin/components/edition/item-metadata-bulk-edition-form.vue b/src/admin/components/edition/item-metadata-bulk-edition-form.vue index 822d04733..47264f68e 100644 --- a/src/admin/components/edition/item-metadata-bulk-edition-form.vue +++ b/src/admin/components/edition/item-metadata-bulk-edition-form.vue @@ -298,7 +298,7 @@ export default { this.isPublishingItems = false; this.isExecutingBulkEdit = false; - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { @@ -313,7 +313,7 @@ export default { } else if (status == 'trash') { - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { diff --git a/src/admin/components/edition/taxonomy-edition-form.vue b/src/admin/components/edition/taxonomy-edition-form.vue index 58a8d0275..f46ac7904 100644 --- a/src/admin/components/edition/taxonomy-edition-form.vue +++ b/src/admin/components/edition/taxonomy-edition-form.vue @@ -264,7 +264,7 @@ formNotSaved = true; if (formNotSaved) { - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { @@ -277,7 +277,7 @@ } }); } else if (this.isEditingTerm) { - this.$modal.open({ + this.$buefy.modal.open({ parent: this, component: CustomDialog, props: { @@ -495,7 +495,7 @@ } } - diff --git a/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list.scss b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list.scss new file mode 100644 index 000000000..b46f3fc0d --- /dev/null +++ b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list.scss @@ -0,0 +1,360 @@ +@import '../../gutenberg-blocks-style.scss'; + +.components-panel__body .collection-carousel-view-modes { + display: flex; + margin: 12px 0 24px 0; + + button { + background: transparent; + border: 1px solid #cbcbcb; + border-radius: 5px; + padding: 2px; + margin: 0; + width: calc(50% - 6px); + flex-shrink: 0; + cursor: pointer; + transition: border ease 0.5s, opacity ease 0.5; + + &.collection-carousel-view-mode-grid { + margin-right: 6px; + div { + display: grid; + grid-template-columns: 33% 33% 33%; + grid-template-rows: 50% 50%; + grid-column-gap: 2px; + grid-row-gap: 2px; + width: 60px; + height: 40px; + margin: 4px auto 8px auto; + + &>div:first-of-type { + grid-column-start: 1; + grid-column-end: span 2; + grid-row-start: 1; + grid-row-end: span 2; + width: 41px; + height: 42px; + } + + &>div { + width: 20px; + height: 20px; + background: #555758; + transition: background-color ease 0.5s; + } + } + } + &.collection-carousel-view-mode-thumbnail { + margin-left: 6px; + + div { + display: block; + height: 40px; + width: 40px; + background: #555758; + margin: 4px auto 8px auto; + transition: background-color ease 0.5s; + } + } + + label { + font-size: 0.75rem; + color: #555758; + } + + &.is-active { + border: 2px solid #298596; + + &.collection-carousel-view-mode-thumbnail div, + &.collection-carousel-view-mode-grid div>div { + background-color: #298596; + } + } + &:hover { + opacity: 0.9; + border-width: 2px; + button { + background: #f2f2f2; + } + } + + } +} + +.wp-block-tainacan-carousel-collections-list { + margin: 2rem 0px; + + // Spinner + .spinner-container { + min-height: 56px; + padding: 1rem; + display: flex; + justify-content: center; + align-items: center; + color: #555758; + } + + // Skeleton loading + @-webkit-keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + @-moz-keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + @-o-keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + @keyframes skeleton-animation { + 0%{opacity: 1.0} + 50%{opacity: 0.2} + 100%{opacity: 1.0} + } + .skeleton { + border-radius: 2px; + background: #f2f2f2; + + -webkit-animation: skeleton-animation 1.8s ease infinite; + -moz-animation: skeleton-animation 1.8s ease infinite; + -o-animation: skeleton-animation 1.8s ease infinite; + animation: skeleton-animation 1.8s ease infinite; + } + + // Tainacan Carousel + .tainacan-carousel { + position: relative; + width: calc(100% + 40px); + left: -20px; + + .swiper-container { + margin: 0 50px; + + a>span, + a:hover>span { + color: black; + font-weight: bold; + text-decoration: none; + padding: 8px 16px; + display: block; + line-height: 1.2rem; + } + a>img { + width: 100%; + height: auto; + } + a:hover { + text-decoration: none; + } + + .swiper-slide.collection-list-item-grid { + + a { + width: 100%; + display: block; + } + .collection-items-grid { + display: grid; + grid-template-columns: 33% 33% 33%; + grid-template-rows: 50% 50%; + width: 100%; + + img:first-of-type { + grid-column-start: 1; + grid-column-end: span 2; + grid-row-start: 1; + grid-row-end: span 2; + } + + img { + width: 100%; + height: auto; + padding: 2px; + margin-bottom: 0px; + } + } + } + } + } + + .preview-warning { + width: 100%; + font-size: 0.875rem; + font-style: italic; + color: #898d8f; + text-align: center; + margin: 4px auto; + } + + // Next and previous buttons + .swiper-button-prev, .swiper-button-next { + top: calc(50% - 42px); + bottom: initial; + background: none; + border: none; + width: 42px; + height: 42px; + padding: 0; + margin: 0 -4px; + + svg { + fill: #298596; + } + } + + // Carousel placeholder on editor side ---------------------------------------------------- + .collections-list-edit-container, + .tainacan-carousel { + position: relative; + + & .skeleton { + min-height: 150px; + max-height: 150px; + } + + &.has-arrows-none .swiper-button-prev, + &.has-arrows-none .swiper-button-next { + display: none; + } + &.has-arrows-left .swiper-button-next { + left: 10px; + right: auto; + top: calc(50% + 12px) !important; + } + &.has-arrows-right .swiper-button-prev { + right: 10px; + left: auto; + } + &.has-arrows-right .swiper-button-next { + top: calc(50% + 12px) !important; + } + } + ul.collections-list-edit { + display: flex; + align-items: flex-start; + overflow-x: scroll; + list-style: none; + margin: 0 36px; + + li.collection-list-item { + position: relative; + display: block; + margin: 16px 32px 16px 0px; + width: calc(16.666% - 32px); + min-width: calc(16.666% - 32px); + + &.collection-list-item-grid { + margin: 16px; + width: calc(25% - 16px); + min-width: calc(25% - 16px); + } + + a { + color: #454647; + font-weight: bold; + line-height: normal; + } + + img { + height: auto; + padding: 0px; + margin-bottom: 0.5rem; + } + + &:hover a { + color: #454647; + text-decoration: none; + } + + button { + position: absolute !important; + background-color: rgba(255, 255, 255, 0.75); + color: #454647; + padding: 2px; + margin-left: 5px; + min-width: 14px; + visibility: hidden; + position: relative; + opacity: 0; + right: -14px; + top: 0px; + justify-content: center; + z-index: 999; + } + + &:hover button { + visibility: visible; + background-color: rgba(255, 255, 255, 1) !important; + opacity: 1; + right: -8px; + top: -8px; + border: 1px solid #cbcbcb; + border-radius: 12px; + transition: opacity linear 0.15s, right linear 0.15s; + } + &:hover button:hover { + background-color: rgba(255, 255, 255, 1) !important; + border: 1px solid #cbcbcb !important; + } + + + .collection-items-grid { + display: grid; + grid-template-columns: 33% 33% 33%; + grid-template-rows: 50% 50%; + + img:first-of-type { + grid-column-start: 1; + grid-column-end: span 2; + grid-row-start: 1; + grid-row-end: span 2; + } + + img { + padding: 2px; + margin-bottom: 0px; + } + } + } + } + @media only screen and (max-width: 1686px) { + + ul.collections-list-edit li.collection-list-item { + width: calc(20% - 32px); + min-width: calc(20% - 32px); + } + } + @media only screen and (max-width: 1452px) { + + ul.collections-list-edit li.collection-list-item { + width: calc(25% - 32px); + min-width: calc(25% - 32px); + } + } + @media only screen and (max-width: 1118px) { + + ul.collections-edit li.collection-list-item { + width: calc(33.333% - 32px); + min-width: calc(33.333% - 32px); + } + } + @media only screen and (max-width: 854px) { + + ul.collections-list-edit li.collection-list-item { + width: calc(50% - 32px); + min-width: calc(50% - 32px); + } + } + @media only screen and (max-width: 584px) { + + ul.collections-list-edit li.collection-list-item { + width: calc(100% - 32px); + min-width: calc(100% - 32px); + } + } + +} diff --git a/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-modal.js b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-modal.js new file mode 100644 index 000000000..033bc9e3b --- /dev/null +++ b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-modal.js @@ -0,0 +1,309 @@ +import tainacan from '../../api-client/axios.js'; +import axios from 'axios'; + +const { __ } = wp.i18n; + +const { TextControl, Button, Modal, CheckboxControl, Spinner } = wp.components; + +export default class CollectionsModal extends React.Component { + constructor(props) { + super(props); + + // Initialize state + this.state = { + searchCollectionName: '', + collectionsRequestSource: undefined, + collections: [], + temporarySelectedCollections: [], + isLoadingCollections: false, + modalCollections: [], + totalModalCollections: 0, + collectionsPerPage: 24, + collectionsPage: 1, + }; + + // Bind events + this.selectTemporaryCollection = this.selectTemporaryCollection.bind(this); + this.removeTemporaryCollectionOfId = this.removeTemporaryCollectionOfId.bind(this); + this.applySelectedCollections = this.applySelectedCollections.bind(this); + this.isTemporaryCollectionSelected = this.isTemporaryCollectionSelected.bind(this); + this.toggleSelectTemporaryCollection = this.toggleSelectTemporaryCollection.bind(this); + this.cancelSelection = this.cancelSelection.bind(this); + this.selectCollection = this.selectCollection.bind(this); + this.fetchModalCollections = this.fetchModalCollections.bind(this); + this.fetchCollections = this.fetchCollections.bind(this); + } + + componentWillMount() { + + this.fetchModalCollections(); + + this.setState( { + collections: [], + collectionsPage: 1, + temporarySelectedCollections: JSON.parse(JSON.stringify(this.props.selectedCollectionsObject)) + } ); + } + + selectTemporaryCollection(collection) { + let existingCollectionIndex = this.state.temporarySelectedCollections.findIndex((existingCollection) => existingCollection.id == collection.id); + + if (existingCollectionIndex < 0) { + let aTemporarySelectedCollections = this.state.temporarySelectedCollections; + aTemporarySelectedCollections.push({ + id: collection.id, + name: collection.name, + url: collection.url, + thumbnail: collection.thumbnail + }); + this.setState({ temporarySelectedCollections: aTemporarySelectedCollections }); + } + } + + removeTemporaryCollectionOfId(collectionId) { + + let existingCollectionIndex = this.state.temporarySelectedCollections.findIndex((existingCollection) => existingCollection.id == collectionId); + + if (existingCollectionIndex >= 0) { + let aTemporarySelectedCollections = this.state.temporarySelectedCollections; + aTemporarySelectedCollections.splice(existingCollectionIndex, 1); + this.setState({ temporarySelectedCollections: aTemporarySelectedCollections }); + } + } + + applySelectedCollections() { + let aSelectedCollectionsObject = JSON.parse(JSON.stringify(this.state.temporarySelectedCollections)); + this.props.onApplySelection(aSelectedCollectionsObject); + } + + isTemporaryCollectionSelected(collectionId) { + return this.state.temporarySelectedCollections.findIndex(collection => collection.id == collectionId) >= 0; + } + + toggleSelectTemporaryCollection(collection, isChecked) { + if (isChecked) + this.selectTemporaryCollection(collection); + else + this.removeTemporaryCollectionOfId(collection.id); + } + + cancelSelection() { + + this.setState({ + collectionsPage: 1, + modalCollections: [] + }); + + this.props.onCancelSelection(); + } + + selectCollection(selectedCollectionId) { + + this.setState({ + collectionId: selectedCollectionId + }); + this.fetchCollection(); + this.fetchModalCollections(); + } + + fetchModalCollections() { + + let currentModalCollections = this.state.modalCollections; + if (this.state.collectionsPage <= 1) + currentModalCollections = []; + + let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage + '&paged=' + this.state.collectionsPage; + + this.setState({ + isLoadingCollections: true, + modalCollections: currentModalCollections, + }); + + tainacan.get(endpoint) + .then(response => { + + for (let collection of response.data) { + currentModalCollections.push({ + name: collection.name, + id: collection.id, + url: collection.url, + thumbnail: [{ + src: collection.thumbnail['tainacan-medium'] != undefined ? collection.thumbnail['tainacan-medium'][0] : collection.thumbnail['medium'][0], + alt: collection.name + }] + }); + } + + this.setState({ + collectionsPage: this.state.collectionsPage + 1, + isLoadingCollections: false, + modalCollections: currentModalCollections, + totalModalCollections: response.headers['x-wp-total'] + }); + + return currentModalCollections; + }) + .catch(error => { + console.log('Error trying to fetch collections: ' + error); + }); + } + + fetchCollections(name) { + if (this.state.collectionsRequestSource != undefined) + this.state.collectionsRequestSource.cancel('Previous collections search canceled.'); + + let aCollectionRequestSource = axios.CancelToken.source(); + this.setState({ + collectionsRequestSource: aCollectionRequestSource, + isLoadingCollections: true + }); + + let endpoint = '/collections/?orderby=title&order=asc&perpage=' + this.state.collectionsPerPage; + + if (name != undefined && name != '') + endpoint += '&search=' + name; + + tainacan.get(endpoint, { cancelToken: aCollectionRequestSource.token }) + .then(response => { + + let someCollections = this.state.collections; + someCollections = response.data.map((collection) => ({ + name: collection.name, + id: collection.id, + url: collection.url, + thumbnail: [{ + src: collection.thumbnail['tainacan-medium'] != undefined ? collection.thumbnail['tainacan-medium'][0] : collection.thumbnail['medium'][0], + alt: collection.name + }] + })); + + this.setState({ + isLoadingCollections: false, + collections: someCollections + }); + + return someCollections; + }) + .catch(error => { + console.log('Error trying to fetch collections: ' + error); + }); + } + + render() { + return ( + this.cancelSelection() } + contentLabel={__('Select collections', 'tainacan')}> + +
+
+ { + this.setState({ + searchCollectionName: value.target.value + }); + }} + onChange={(value) => this.fetchCollections(value)}/> +
+ {( + this.state.searchCollectionName != '' ? ( + + this.state.collections.length > 0 ? + ( +
+
    + { + this.state.collections.map((collection) => +
  • + { collection.thumbnail ? + { + : null + } + { this.toggleSelectTemporaryCollection(collection, isChecked) } } + /> +
  • + ) + } +
+ { this.state.isLoadingCollections ?
: null } +
+ ) + : this.state.isLoadingCollections ?
: +
+

{ __('Sorry, no collections found.', 'tainacan') }

+
+ ) : + this.state.modalCollections.length > 0 ? + ( +
+
    + { + this.state.modalCollections.map((collection) => +
  • + { collection.thumbnail ? + { + : null + } + { this.toggleSelectTemporaryCollection(collection, isChecked) } } /> +
  • + ) + } + { this.state.isLoadingCollections ?
    : null } +
+
+

{ __('Showing', 'tainacan') + " " + this.state.modalCollections.length + " " + __('of', 'tainacan') + " " + this.state.totalModalCollections + " " + __('collections', 'tainacan') + "."}

+ { + this.state.modalCollections.length < this.state.totalModalCollections ? ( + + ) : null + } +
+
+ ) : this.state.isLoadingCollections ? : +
+

{ __('Sorry, no collections found.', 'tainacan') }

+
+ )} +
+ + +
+
+
+ ); + } +} \ No newline at end of file diff --git a/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js new file mode 100644 index 000000000..2be2ca942 --- /dev/null +++ b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js @@ -0,0 +1,551 @@ +const { registerBlockType } = wp.blocks; + +const { __ } = wp.i18n; + +const { RangeControl, Spinner, Button, BaseControl, ToggleControl, SelectControl, Placeholder, IconButton, PanelBody } = wp.components; + +const { InspectorControls } = wp.editor; + +import CarouselCollectionsModal from './carousel-collections-modal.js'; +import tainacan from '../../api-client/axios.js'; +import axios from 'axios'; +import qs from 'qs'; + +registerBlockType('tainacan/carousel-collections-list', { + title: __('Tainacan Collections Carousel', 'tainacan'), + icon: + + + , + category: 'tainacan-blocks', + keywords: [ __( 'collections', 'tainacan' ), __( 'carousel', 'tainacan' ), __( 'slider', 'tainacan' ) ], + attributes: { + content: { + type: 'array', + source: 'children', + selector: 'div' + }, + collections: { + type: Array, + default: [] + }, + isModalOpen: { + type: Boolean, + default: false + }, + selectedCollections: { + type: Array, + default: [] + }, + itemsRequestSource: { + type: String, + default: undefined + }, + maxCollectionsNumber: { + type: Number, + value: undefined + }, + isLoading: { + type: Boolean, + value: false + }, + isLoadingCollection: { + type: Boolean, + value: false + }, + arrowsPosition: { + type: String, + value: 'search' + }, + autoPlay: { + type: Boolean, + value: false + }, + autoPlaySpeed: { + type: Number, + value: 3 + }, + loopSlides: { + type: Boolean, + value: false + }, + hideName: { + type: Boolean, + value: true + }, + showCollectionThumbnail: { + type: Boolean, + value: false + }, + collection: { + type: Object, + value: undefined + }, + blockId: { + type: String, + default: undefined + }, + collectionBackgroundColor: { + type: String, + default: "#454647" + }, + collectionTextColor: { + type: String, + default: "#ffffff" + } + }, + supports: { + align: ['full', 'wide'], + html: false, + multiple: true + }, + edit({ attributes, setAttributes, className, isSelected, clientId }){ + let { + collections, + content, + isModalOpen, + itemsRequestSource, + selectedCollections, + isLoading, + arrowsPosition, + autoPlay, + autoPlaySpeed, + loopSlides, + hideName, + showCollectionThumbnail + } = attributes; + + // Obtains block's client id to render it on save function + setAttributes({ blockId: clientId }); + + function prepareItem(collection, collectionItems) { + return ( +
  • + removeItemOfId(collection.id) } + icon="no-alt" + label={__('Remove', 'tainacan')}/> + + { !showCollectionThumbnail ? +
    + { + { + { +
    + : + { + } + { !hideName ? { collection.name ? collection.name : '' } : null } +
    +
  • + ); + } + + function setContent(){ + isLoading = true; + + setAttributes({ + isLoading: isLoading + }); + + if (itemsRequestSource != undefined && typeof itemsRequestSource == 'function') + itemsRequestSource.cancel('Previous collections search canceled.'); + + itemsRequestSource = axios.CancelToken.source(); + + collections = []; + + let endpoint = '/collections?'+ qs.stringify({ postin: selectedCollections }) + '&fetch_only=name,url,thumbnail'; + tainacan.get(endpoint, { cancelToken: itemsRequestSource.token }) + .then(response => { + + if (showCollectionThumbnail) { + for (let collection of response.data) { + collections.push(prepareItem(collection)); + } + setAttributes({ + content:
    , + collections: collections, + isLoading: false, + itemsRequestSource: itemsRequestSource + }); + } else { + let promises = []; + for (let collection of response.data) { + promises.push( + tainacan.get('/collection/' + collection.id + '/items?perpage=3&fetch_only=name,url,thumbnail') + .then(response => { return({ collection: collection, collectionItems: response.data.items }) }) + .catch((error) => console.log(error)) + ); + } + axios.all(promises).then((results) => { + for (let result of results) { + collections.push(prepareItem(result.collection, result.collectionItems)); + } + setAttributes({ + content:
    , + collections: collections, + isLoading: false, + itemsRequestSource: itemsRequestSource + }); + }) + } + }); + } + + function openCarouselModal() { + isModalOpen = true; + setAttributes( { + isModalOpen: isModalOpen + } ); + } + + function removeItemOfId(itemId) { + + let existingItemIndex = collections.findIndex((existingItem) => existingItem.key == itemId); + if (existingItemIndex >= 0) + collections.splice(existingItemIndex, 1); + + let existingSelectedItemIndex = selectedCollections.findIndex((existingSelectedItem) => existingSelectedItem == itemId); + if (existingSelectedItemIndex >= 0) + selectedCollections.splice(existingSelectedItemIndex, 1); + + setAttributes({ + selectedCollections: selectedCollections, + collections: collections, + content:
    + }); + } + + // Executed only on the first load of page + if(content && content.length && content[0].type) + setContent(); + + return ( +
    + +
    + + + +
    + {/* { + showCollectionThumbnail = isChecked; + setAttributes({ showCollectionThumbnail: showCollectionThumbnail }); + setContent(); + } + } + /> */} + +
    + + +
    +
    + { + hideName = isChecked; + setAttributes({ hideName: hideName }); + setContent(); + } + } + /> + { + loopSlides = isChecked; + setAttributes({ loopSlides: loopSlides }); + } + } + /> + { + autoPlay = isChecked; + setAttributes({ autoPlay: autoPlay }); + } + } + /> + { + autoPlay ? + { + autoPlaySpeed = aAutoPlaySpeed; + setAttributes( { autoPlaySpeed: aAutoPlaySpeed } ) + }} + min={ 1 } + max={ 5 } + /> + : null + } + { + arrowsPosition = aPosition; + + setAttributes({ arrowsPosition: arrowsPosition }); + }}/> +
    +
    +
    +
    + + { isSelected ? + ( +
    + { isModalOpen ? + { + selectedCollections = selectedCollections.concat(aSelectionOfCollections.map((collection) => { return collection.id; })); + setAttributes({ + selectedCollections: selectedCollections, + isModalOpen: false + }); + setContent(); + }} + onCancelSelection={ () => setAttributes({ isModalOpen: false }) }/> + : null + } + + { collections.length ? ( +
    +

    + + + + {__('List collections on a Carousel', 'tainacan')} +

    + +
    + ): null + } +
    + ) : null + } + + { !collections.length && !isLoading ? ( + + )}> +

    + + + + {__('List collections on a Carousel, using search or collection selection.', 'tainacan')} +

    + +
    + ) : null + } + + { isLoading ? +
    + +
    : +
    + { isSelected && collections.length ? +
    {__('Warning: this is just a demonstration. To see the carousel in action, either preview or publish your post.', 'tainacan')}
    + : null + } + { collections.length ? ( +
    + +
      + { collections } +
    + +
    + ):null + } +
    + } +
    + ); + }, + save({ attributes, className }){ + const { + content, + blockId, + selectedCollections, + arrowsPosition, + maxCollectionsNumber, + autoPlay, + autoPlaySpeed, + loopSlides, + hideName, + showCollectionThumbnail + } = attributes; + return
    + { content } +
    + } +}); \ No newline at end of file diff --git a/src/gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss b/src/gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss index c65e9d809..1b7ecfaf8 100644 --- a/src/gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss +++ b/src/gutenberg-blocks/tainacan-collections/collections-list/collections-list.scss @@ -121,26 +121,26 @@ ul.collections-list.collections-layout-list, ul.collections-list-edit.collections-layout-list { padding: 0; - display: block; + display: flex; + flex-wrap: wrap; + align-items: center; list-style-type: none; li.collection-list-item { position: relative; - display: inline-block; margin: 12px 12px 24px 12px; margin-bottom: 12px; min-height: 54px; - min-width: 22%; - width: 22%; + min-width: calc(20% - 24px); + width: calc(20% - 24px); a { color: #454647; - // overflow: hidden; - // text-overflow: ellipsis; - // white-space: nowrap; + height: auto; display: flex; align-items: center; - height: 54px; + word-break: break-all; + word-break: break-word; } img { @@ -151,6 +151,7 @@ margin-right: 20px; } + a.collection-without-image img { display: none; } @@ -159,31 +160,26 @@ color: #454647; text-decoration: none; } + + @media only screen and (max-width: 1600px) { + min-width: calc(25% - 24px); + width: calc(25% - 24px); + } + + @media only screen and (max-width: 1024px) { + min-width: calc(33.333% - 24px); + width: calc(33.333% - 24px); + } + + @media only screen and (max-width: 768px) { + min-width: calc(50% - 24px); + width: calc(50% - 24px); + } + + @media only screen and (max-width: 498px) { + min-width: calc(100% - 24px); + width: calc(100% - 24px); + } } } - - @media only screen and (max-width: 1600px) { - ul.collections-list.collections-layout-list li.collection-list-item, - ul.collections-list-edit.collections-layout-list li.collection-list-item { - min-width: 30%; - width: 30%; - } - } - - @media only screen and (max-width: 1024px) { - ul.collections-list.collections-layout-list li.collection-list-item, - ul.collections-list-edit.collections-layout-list li.collection-list-item { - min-width: 45%; - width: 45%; - } - } - - @media only screen and (max-width: 768px) { - ul.collections-list.collections-layout-list li.collection-list-item, - ul.collections-list-edit.collections-layout-list li.collection-list-item { - min-width: 100%; - width: 100%; - } - } - } diff --git a/src/gutenberg-blocks/tainacan-collections/collections-list/collections-modal.js b/src/gutenberg-blocks/tainacan-collections/collections-list/collections-modal.js index 9a423acbc..8ebd20a40 100644 --- a/src/gutenberg-blocks/tainacan-collections/collections-list/collections-modal.js +++ b/src/gutenberg-blocks/tainacan-collections/collections-list/collections-modal.js @@ -201,6 +201,7 @@ export default class CollectionsModal extends React.Component {
    { diff --git a/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue b/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue index be8e24a2b..d25d45220 100644 --- a/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue +++ b/src/gutenberg-blocks/tainacan-facets/facets-list/facets-list-theme.vue @@ -133,7 +133,7 @@