handling 'brochures' option to the post type selection in OptionsSelectControl
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2025-03-18 09:37:20 +01:00
parent 0e355be895
commit 2a798c2611
8 changed files with 56 additions and 60 deletions

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '354aaf4f576100a5c65a');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '14a1977b67ac39219b7d');

View File

@ -1,6 +1,6 @@
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*!****************************************************************************************************************************************************************************************************************************************************!*\
!*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
\****************************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied inside the editor only.
*

View File

@ -12,8 +12,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ OptionsSelectControl)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
@ -23,10 +23,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_6__);
@ -43,8 +41,8 @@ function OptionsSelectControl({
hasDescription,
postType
}) {
if (!postType || !setAttributes) return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, "Loading");
let [postOptions, setPostOptions] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(null);
if (!postType || !setAttributes) return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, "Loading");
let [postOptions, setPostOptions] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
const lang = getAdminLanguageFromCookie("wp-wpml_current_language");
const optionPages = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
if (!postType) return null;
@ -98,7 +96,7 @@ function OptionsSelectControl({
optionPages.forEach(page => {
options.push({
value: page.id,
label: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_7__.decodeEntities)(page.title.rendered)
label: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_6__.decodeEntities)(page.title.rendered)
});
});
} else {
@ -109,16 +107,16 @@ function OptionsSelectControl({
}
return options;
}
(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (!optionPages || !postType) return;
if (optionPages && optionPages.length > 0) {
setPostOptions(buildSelectOptions(optionPages));
}
}, [optionPages, postType]);
let panelTitle = "Post Reliée";
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Contenu Reliée", "homegrade-blocks")
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Type de post", "homegrade-blocks"),
options: [{
value: "conseils",
@ -132,21 +130,24 @@ function OptionsSelectControl({
}, {
value: "videos-webinaires",
label: "Videos / Webinaires"
}, {
value: "brochures",
label: "Brochures"
}],
value: postType !== null && postType !== void 0 ? postType : null,
onChange: handlePostTypeChange
}), postOptions && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ComboboxControl, {
}), postOptions && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ComboboxControl, {
label: panelTitle,
value: relatedPostId,
options: postOptions,
onChange: e => handleRelatedPostChange(e)
}), relatedPostId && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Tip, null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Pourrrrrr modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.", "homegrade-blocks")), relatedPostId && editUrl && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
}), relatedPostId && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Tip, null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Pourrrrrr modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.", "homegrade-blocks")), relatedPostId && editUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
href: editUrl,
className: "edit-question-button"
}, "\xC9diter le post")), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
}, "\xC9diter le post")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Texte descriptif", "homegrade-blocks"),
initialOpen: false
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.CheckboxControl, {
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.CheckboxControl, {
label: "Texte descriptif",
help: "\xC0 cocher pour afficher un texte descriptif libre",
checked: hasDescription,
@ -166,8 +167,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ Edit)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
@ -223,36 +224,36 @@ function Edit({
postDescription: description
});
}
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_OptionsSelectControl__WEBPACK_IMPORTED_MODULE_6__["default"], {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_OptionsSelectControl__WEBPACK_IMPORTED_MODULE_6__["default"], {
relatedPostId: relatedPostId,
postType: postType,
hasDescription: hasDescription,
postDescription: postDescription,
setAttributes: setAttributes
}), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({
className: `post-card`
})
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
class: "post-card__cover",
alt: "",
src: thematiqueCoverUrl
}), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
class: "post-card__details"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
class: "post-card__tags"
}, postParentTaxonomy && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
}, postParentTaxonomy && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
class: "tag thematique-tag thematique-tag--" + postParentTaxonomy.slug
}, postParentTaxonomy.name), postTypeDatas && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
}, postParentTaxonomy.name), postTypeDatas && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
class: "tag post-type-tag"
}, postTypeDatas.label)), currentRelatedPost && currentRelatedPost.title && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
}, postTypeDatas.label)), currentRelatedPost && currentRelatedPost.title && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
class: "post-card__title"
}, (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__.decodeEntities)(currentRelatedPost.title.rendered)), hasDescription && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
}, (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__.decodeEntities)(currentRelatedPost.title.rendered)), hasDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
tagName: "p",
onChange: handlePostDescriptionChange // Store updated content as a block attribute
,
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Heading...") // Insérez votre description
})), !relatedPostId && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ce bloc n'est relié à aucun post. Rattachez-le à un post dans la barre latérale.", "homegrade-blocks__texte-backoffice")))));
})), !relatedPostId && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Ce bloc n'est relié à aucun post. Rattachez-le à un post dans la barre latérale.", "homegrade-blocks__texte-backoffice")))));
}
/***/ }),
@ -264,8 +265,8 @@ function Edit({
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
@ -278,12 +279,12 @@ __webpack_require__.r(__webpack_exports__);
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, {
icon: {
src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "62.01",
height: "58.04",
viewBox: "0 0 62.01 58.04"
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
class: "cls-1",
d: "M14.68,21.37c5.73-2.02,8.73-8.31,6.71-14.04C19.36,1.61,13.08-1.39,7.35.63,1.62,2.66-1.38,8.94.64,14.67c1.11,3.13,3.57,5.6,6.71,6.71l.67.24v14.82l-.68.23c-5.73,2.02-8.73,8.31-6.71,14.04,2.02,5.73,8.31,8.73,14.04,6.71,5.73-2.02,8.73-8.31,6.71-14.04-1.11-3.13-3.57-5.6-6.71-6.71l-.66-.23v-14.82l.67-.24ZM16.01,47.02c0,2.76-2.24,5-5,5s-5-2.24-5-5,2.24-5,5-5,5,2.24,5,5ZM11.01,16.02c-2.76,0-5-2.24-5-5s2.24-5,5-5,5,2.24,5,5-2.24,5-5,5ZM34.01,8.02h25c1.66,0,3-1.34,3-3s-1.34-3-3-3h-25c-1.66,0-3,1.34-3,3s1.34,3,3,3ZM59.01,18.02h-25c-1.66,0-3,1.34-3,3s1.34,3,3,3h25c1.66,0,3-1.34,3-3s-1.34-3-3-3ZM59.01,34.02h-25c-1.66,0-3,1.34-3,3s1.34,3,3,3h25c1.66,0,3-1.34,3-3s-1.34-3-3-3ZM59.01,50.02h-25c-1.66,0-3,1.34-3,3s1.34,3,3,3h25c1.66,0,3-1.34,3-3s-1.34-3-3-3Z"
}))),
@ -316,16 +317,6 @@ __webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "react":
/*!************************!*\
!*** external "React" ***!
\************************/
/***/ ((module) => {
module.exports = window["React"];
/***/ }),
/***/ "@wordpress/block-editor":
@ -414,7 +405,7 @@ module.exports = window["wp"]["i18n"];
\************************/
/***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/post-card","version":"0.1.0","title":"Post Link","category":"homegrade-blocks","description":"Pour afficher le lien vers un post (conseil, fiche-info, …) dans une carte","supports":{"anchor":true,"html":false},"textdomain":"homegrade-theme__bloks-texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"relatedPostId":{"type":"number"},"postType":{"type":"string","default":"conseils"},"hasDescription":{"type":"boolean","default":false},"postDescription":{"type":"string"}}}');
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/post-card","version":"0.1.0","title":"Post Link","category":"homegrade-blocks","description":"Pour afficher le lien vers un post (conseil, fiche-info, …) dans une carte","supports":{"anchor":true,"html":false},"textdomain":"homegrade-theme__bloks-texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"relatedPostId":{"type":"number"},"postType":{"type":"string","default":"conseils"},"hasDescription":{"type":"boolean","default":false},"postDescription":{"type":"string"}}}');
/***/ })
@ -460,7 +451,9 @@ module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/tru
/******/ }
/******/ var notFulfilled = Infinity;
/******/ for (var i = 0; i < deferred.length; i++) {
/******/ var [chunkIds, fn, priority] = deferred[i];
/******/ var chunkIds = deferred[i][0];
/******/ var fn = deferred[i][1];
/******/ var priority = deferred[i][2];
/******/ var fulfilled = true;
/******/ for (var j = 0; j < chunkIds.length; j++) {
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
@ -546,7 +539,9 @@ module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/tru
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
@ -569,7 +564,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/tru
/******/ return __webpack_require__.O(result);
/******/ }
/******/
/******/ var chunkLoadingGlobal = globalThis["webpackChunkmultiblocks"] = globalThis["webpackChunkmultiblocks"] || [];
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();

File diff suppressed because one or more lines are too long

View File

@ -17,9 +17,9 @@ $postDescription = $attributes['postDescription'] ?? null;
$coverUrl = $postType->name === 'videos-webinaires' && $postThumbnail ? $postThumbnail : ($thematique_icon ? $thematique_icon['url'] : null);
$thematiqueColorSlug = getThematiqueFamilySlug($mainThematique->slug);
$target = $postType->name === 'brochures' ? "_blank" : "_self";
?>
<a class="post-card post-card--<?php echo $mainThematique->slug ?>" href="<?php echo $relatedPostUrl ?>">
<a class="post-card post-card--<?php echo $mainThematique->slug ?>" href="<?php echo $relatedPostUrl ?>" target="<?php echo $target ?>">
<img class="post-card__cover post-card__cover--<?php echo $postType->name ?>" src="<?php echo $coverUrl ?>" alt="">

View File

@ -1,6 +1,6 @@
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
\**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*!***************************************************************************************************************************************************************************************************************************************************!*\
!*** css ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
\***************************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied both on the front of your site
* and in the editor.

View File

@ -34,7 +34,7 @@ export default function OptionsSelectControl({
};
return select("core").getEntityRecords("postType", postType, query);
},
[postType, lang],
[postType, lang]
);
const editUrl = relatedPostId
? `${window.location.origin}/wp-admin/post.php?post=${relatedPostId}&action=edit`
@ -102,6 +102,7 @@ export default function OptionsSelectControl({
{ value: "fiches-infos", label: "Fiches infos" },
{ value: "questions", label: "Questions" },
{ value: "videos-webinaires", label: "Videos / Webinaires" },
{ value: "brochures", label: "Brochures" },
]}
value={postType ?? null}
onChange={handlePostTypeChange}
@ -119,7 +120,7 @@ export default function OptionsSelectControl({
<Tip>
{__(
"Pourrrrrr modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.",
"homegrade-blocks",
"homegrade-blocks"
)}
</Tip>
)}

View File

@ -17,9 +17,9 @@ $postDescription = $attributes['postDescription'] ?? null;
$coverUrl = $postType->name === 'videos-webinaires' && $postThumbnail ? $postThumbnail : ($thematique_icon ? $thematique_icon['url'] : null);
$thematiqueColorSlug = getThematiqueFamilySlug($mainThematique->slug);
$target = $postType->name === 'brochures' ? "_blank" : "_self";
?>
<a class="post-card post-card--<?php echo $mainThematique->slug ?>" href="<?php echo $relatedPostUrl ?>">
<a class="post-card post-card--<?php echo $mainThematique->slug ?>" href="<?php echo $relatedPostUrl ?>" target="<?php echo $target ?>">
<img class="post-card__cover post-card__cover--<?php echo $postType->name ?>" src="<?php echo $coverUrl ?>" alt="">