From 4f29a74cb17893c8e8a70826c78b68d672380d27 Mon Sep 17 00:00:00 2001 From: thomas nares Date: Mon, 27 Nov 2023 11:33:57 +0100 Subject: [PATCH 1/2] Document NavigationTabType --- .../img/navigation-tab-type.png | Bin 0 -> 15880 bytes .../types-reference/navigation-tab-type.md | 51 ++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 development/components/form/types-reference/img/navigation-tab-type.png diff --git a/development/components/form/types-reference/img/navigation-tab-type.png b/development/components/form/types-reference/img/navigation-tab-type.png new file mode 100644 index 0000000000000000000000000000000000000000..9dc576a62e016d7d16d6d8e33d72730e42d9f999 GIT binary patch literal 15880 zcmeIZWmFv96Fvw5f=eJka0?;0Yp~!1hv4om!C`PGxVt-p6WpEP5*!A1cZZ$4zxNF} zyWjSlJ^SU)>0x@h`__GKRdwI0r)~$!N{b>R;37akKp=~Y3CTl1yaIst+u>e=|GVYq z!9hSkel`^plob~gB$l;}Fb{Fjm7wr>#CohB& z2Kok)fi`3nOf)mPg4Y2Bf2}lnv@;hvo*6xy4F?`x1CBZ_x((HC=KGp#XrWKr*k7>> z^NnLaa=a4!sMx_wuPP(j(cj)5o0U2lt0S(@R1b=YB z9|#Dj=l}><@Haa6Bb52-zq79ZnNa`jL$rg>L3~ya6c-17E9l!A8d}+zSlge=$bSQi znl}BaVy_}4$)#^?NvCUIt!GH*Y-#hm2?Vz@7kJmw&|a6=+0w$wj?0;c^q(uZ!27=s z(~}babBVn<52=cjEU}=qtsyZR9RnQ$DK7#sF)_ETff1LykjTHy!M}J&P3-M$xajGf zoSf*KnCYx-jp-RVIXUSWnCO|9Xu(&|+PPTS>pIg~*^&KE$bWK#4DIx7O>OK=t*wZE z%hlDhcChCmCH>vepTGa%G;}t7>B-9O-(i6VNdNl`JtG|h{U6!jrrf`ea><%H8(OFe znOcI?1MY*Dk&}u0pX>i0XI^^ztEI|IOEzZKzgzxw=KtPO(az9T(ApB*r9JP9W&Uma z_sM@7a?}4F`Cpp&pPK(U3f40(0yq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bLitFOX?Ger0qOL_QKYgHLsTmvm`LWqdS>E<_Qt&QpUpUc> zs3MgzlMGIuXgFaDDKb3B9t6jlg1ia&pZ|J|zUgU>Md%1z zU2?TIJB|}V#H4!vJO4(;V^2E#?y4tN7PQRNP;=?^kPBh17}eSb;)xvub8rHln(a;IXMroAMPOj4 z>$RZiTz1k|dA*}`#tidvt-%ZTtNh^`>8D4hgk~nUMCf807A%0<&G96?fQTzSzBr>I4LprbF;9Tfz@;vy@PXr?R=)biL|Q_B6}zlY%o!7Hsdy_W9Ia=2nQu;!EdRu@W z-h)_lMt^XCsY7tfZT0n@=@(j-zZMQW_xQ&m^(&G6uVaK)-ede8*O-3a42Z-sGvC;R z%%0QlQ2_My5OJxm{+U?t(PtfQ3g1dS^HmWTt^LE<^~1ihdIQ+}A}p4A_iTAhn71+* z$Y>Y`))(Q2lMHm%J`8CIm&+y5e}WuqGT9vy$pdmg*!OTMOZvIZA6*pE10Cz%e!qPK zA1qF%oiG{d;UWB}E_?JHakFfvWb!PMNicYg}&)UMcWkIvkuASd}IB{7DADQA2$S zm{E74;?>$&vSau7+Y64!!L)kTyuvB`TeqXl(TTs9|5E7G?=2e}2Ejaz8gv?B`8#&| z3>7wic?&8epYnHMv4p?gL43agfKGM2ax4F2!T2|@IPm=(_d4Q5dZrinKBd-y8aVnB z)I@syzrX5a{W)5$T_kqtB^HB3gmk^4VQ~K6Ym5Jc5ins8JOCI=p*f}}](https://github.com/PrestaShop/PrestaShop/pull/28752) in the product form. + +The new Product page uses this form type as the base form type. + +Its example usage has been documented in an example module: [`demoproductform`](https://github.com/PrestaShop/example-modules/tree/master/demoproductform). + +The module hooks to `actionProductFormBuilderModifier` to modify the `FormBuilder` for the Product page. +The `ProductFormModifier` adds a new `CustomTabType` (created by the module) to the `FormBuilder` (which is a `NavigationTabType`). + +```php +$this->formBuilderModifier->addAfter( + $productFormBuilder, + 'pricing', + 'custom_tab', + CustomTabType::class, + [ + 'data' => [ + 'custom_price' => $customProduct->custom_price, + ], + ] +); +``` + +This `CustomTabType` contains a simple form type: + +```php +public function buildForm(FormBuilderInterface $builder, array $options) +{ + parent::buildForm($builder, $options); + $builder + ->add('custom_price', MoneyType::class, [ + 'label' => $this->trans('My custom price', 'Modules.Demoproductform.Admin'), + 'label_tag_name' => 'h3', + 'currency' => $this->defaultCurrency->iso_code, + 'required' => false, + 'constraints' => [ + new NotBlank(), + new Type(['type' => 'float']), + new PositiveOrZero(), + ], + ]) + ; +} +``` + +It is rendered this way in the BO Product page: + +{{< figure src="../img/navigation-tab-type.png" title="NavigationTabType" >}} From 3cfab6f3c8930858915f60a4637d43f45fae7dd3 Mon Sep 17 00:00:00 2001 From: Thomas NARES Date: Tue, 5 Dec 2023 15:51:50 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Krystian Podemski --- .../form/types-reference/navigation-tab-type.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/development/components/form/types-reference/navigation-tab-type.md b/development/components/form/types-reference/navigation-tab-type.md index 36764fd4c9..2d363cada5 100644 --- a/development/components/form/types-reference/navigation-tab-type.md +++ b/development/components/form/types-reference/navigation-tab-type.md @@ -16,11 +16,11 @@ This form type is used as a container of sub forms, each sub form will be render ## Usage and description -This form type [was introduced in {{< minver v="8.1.0">}}](https://github.com/PrestaShop/PrestaShop/pull/28752) in the product form. +This form type [was introduced in {{< minver v="8.1.0">}}](https://github.com/PrestaShop/PrestaShop/pull/28752) in the new product page. -The new Product page uses this form type as the base form type. +The new product page is based on this form type. -Its example usage has been documented in an example module: [`demoproductform`](https://github.com/PrestaShop/example-modules/tree/master/demoproductform). +Its usage has been documented in an example module: [`demoproductform`](https://github.com/PrestaShop/example-modules/tree/master/demoproductform). The module hooks to `actionProductFormBuilderModifier` to modify the `FormBuilder` for the Product page. The `ProductFormModifier` adds a new `CustomTabType` (created by the module) to the `FormBuilder` (which is a `NavigationTabType`). @@ -61,6 +61,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) } ``` -It is rendered this way in the BO Product page: +Preview of how it looks in the back office: {{< figure src="../img/navigation-tab-type.png" title="NavigationTabType" >}}