-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new group display mode for quick form widget #63
Conversation
veve40
commented
Jun 2, 2022
•
edited by mcaskill
Loading
edited by mcaskill
- Add support for grouping properties by the language, for multilingual form properties.
- Centralize sort by priority comparator functions to minimize duplicate code.
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Avoid useless ternary expression Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Avoid useless ternary expression Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Improve returned data as json for debugging purpose Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Summary of a chat between @veve40, @mcaskill, @JoelAlphonso:
Proposed structure for `HasLanguageSwitcherTrait`public function showLanguageSwitch()
{
if ($this->showLanguageSwitch === null) {
$this->showLanguageSwitch = $this->resolveShowLanguageSwitch();
}
return $this->showLanguageSwitch;
}
abstract protected function resolveShowLanguageSwitch(); `QuickFormWidget` / `ObjectFormWidget`protected function resolveShowLanguageSwitch()
{
return $this->hasL10nFormProperties();
} `FormSidebarWidget`protected function resolveShowLanguageSwitch()
{
if ($form) {
return $form->hasL10nFormProperties();
}
return false;
} |
…ed in FormSidebarWidget and QuickFormWidget
…msByPriority, sortGroupsByPriority, sortActionsByPriority into one supportByPriority function
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
Co-authored-by: Chauncey McAskill <chauncey@mcaskill.ca>
…entation from QuickFormWidget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. All that's missing is adding isDisplayModeLang
and showLanguageSwitch
to a QuickFormWidget::widgetDataForJs()
method to wrap the trigger and event lisener that you moved to quickform.js
.
Added support for grouping properties by language, for multilingual form properties: ```json { "type": "charcoal/admin/widget/quick-form", "form_ident": "quick-edit", "group_display_mode": "lang" } ``` Merged from locomotivemtl/charcoal-admin#63: * 1st version of new group_display_mode for quick-form * add class for specific display mode lang on quick-form widget to improve css trigger * add use of ModelStructureProperty in QuickFormWidget * use trans method instead of translate * move quickform custom lang css * migrate showLanguageSwith to his own Combo Interface/Trait. Implemented in FormSidebarWidget and QuickFormWidget * Add support class Sorter and migrate sortLanguagesByPriority, sortItemsByPriority, sortGroupsByPriority, sortActionsByPriority into one supportByPriority function * change css with new -tabbed-by-lang class for quick form * build css * move custom JS file to quickform.js * replace hasL10nFormProperties method for ObjectFormWidget with implementation from QuickFormWidget * add getTabbableDisplayModes * improve quickform JS adding variable for lang switcher in widgetDataForJs * wrapped the event listener for lang tab on quickform with condition (cherry picked from commit locomotivemtl/charcoal-admin#d27a30e44b0e6e06899a481322015b09e743dc82)
Added support for grouping properties by language, for multilingual form properties: ```json { "type": "charcoal/admin/widget/quick-form", "form_ident": "quick-edit", "group_display_mode": "lang" } ``` Merged from locomotivemtl/charcoal-admin#63: * 1st version of new group_display_mode for quick-form * add class for specific display mode lang on quick-form widget to improve css trigger * add use of ModelStructureProperty in QuickFormWidget * use trans method instead of translate * move quickform custom lang css * migrate showLanguageSwith to his own Combo Interface/Trait. Implemented in FormSidebarWidget and QuickFormWidget * Add support class Sorter and migrate sortLanguagesByPriority, sortItemsByPriority, sortGroupsByPriority, sortActionsByPriority into one supportByPriority function * change css with new -tabbed-by-lang class for quick form * build css * move custom JS file to quickform.js * replace hasL10nFormProperties method for ObjectFormWidget with implementation from QuickFormWidget * add getTabbableDisplayModes * improve quickform JS adding variable for lang switcher in widgetDataForJs * wrapped the event listener for lang tab on quickform with condition (cherry picked from commit locomotivemtl/charcoal-admin#d27a30e44b0e6e06899a481322015b09e743dc82)
Added support for grouping properties by language, for multilingual form properties: ```json { "type": "charcoal/admin/widget/quick-form", "form_ident": "quick-edit", "group_display_mode": "lang" } ``` Merged from locomotivemtl/charcoal-admin#63: * 1st version of new group_display_mode for quick-form * add class for specific display mode lang on quick-form widget to improve css trigger * add use of ModelStructureProperty in QuickFormWidget * use trans method instead of translate * move quickform custom lang css * migrate showLanguageSwith to his own Combo Interface/Trait. Implemented in FormSidebarWidget and QuickFormWidget * Add support class Sorter and migrate sortLanguagesByPriority, sortItemsByPriority, sortGroupsByPriority, sortActionsByPriority into one supportByPriority function * change css with new -tabbed-by-lang class for quick form * build css * move custom JS file to quickform.js * replace hasL10nFormProperties method for ObjectFormWidget with implementation from QuickFormWidget * add getTabbableDisplayModes * improve quickform JS adding variable for lang switcher in widgetDataForJs * wrapped the event listener for lang tab on quickform with condition (cherry picked from commit locomotivemtl/charcoal-admin#d27a30e44b0e6e06899a481322015b09e743dc82)
## [3.0.0](v2.3.0...v3.0.0) (2022-07-20) ### ⚠ BREAKING CHANGES * (BC): - Method `widgetOptions()` now returns an array instead of a JSON serialized string to allow for easier overriding in subclasses. Added: - Methods `widgetOptionsAsJson()` and `escapedWidgetOptionsAsJson()` for rendering widget options as JSON. - Method `widgetDataForJs()` to replace hardcoded widget data options in view file. Changed: - Stringify the widget's title. ### Features * **admin:** Add new group display mode for quick form widget ([524ec25](524ec25)), closes [locomotivemtl/charcoal-admin#63](locomotivemtl/charcoal-admin#63) [locomotivemtl/charcoal-admin#d27a30e44b0e6e06899a481322015b09e743dc82](https://github.com/locomotivemtl/charcoal-admin/issues/d27a30e44b0e6e06899a481322015b09e743dc82) * **admin:** Improve dialog in widget.js ([1855d3b](1855d3b)), closes [locomotivemtl/charcoal-admin#8eb005a375875a7158537898c357b050ab066050](https://github.com/locomotivemtl/charcoal-admin/issues/8eb005a375875a7158537898c357b050ab066050) * **admin:** Improve error handling in form.js ([8340eb6](8340eb6)), closes [locomotivemtl/charcoal-admin#6659001b72230e62f353ac533e449ffec40221d4](https://github.com/locomotivemtl/charcoal-admin/issues/6659001b72230e62f353ac533e449ffec40221d4) * **admin:** Improve generic graph widgets ([b8a03f6](b8a03f6)), closes [locomotivemtl/charcoal-admin#8e482bd13688c8b3d2770078424b6117eba3d0](https://github.com/locomotivemtl/charcoal-admin/issues/8e482bd13688c8b3d2770078424b6117eba3d0) * **admin:** Improve reloading in widget.js ([f409aac](f409aac)), closes [locomotivemtl/charcoal-admin#d8d977c1609515b144837d1d1ca3f11677972](https://github.com/locomotivemtl/charcoal-admin/issues/d8d977c1609515b144837d1d1ca3f11677972) * **admin:** Improve showLanguageSwitch integration ([41f341f](41f341f)), closes [locomotivemtl/charcoal-admin#9c436ea57c5a37e90f97f90cf78994ab66cd0083](https://github.com/locomotivemtl/charcoal-admin/issues/9c436ea57c5a37e90f97f90cf78994ab66cd0083) * **admin:** Improve switch language in form.js ([22c30ec](22c30ec)), closes [locomotivemtl/charcoal-admin#e9d29556820f0b2f4e6a6adc127c31dad86fae04](https://github.com/locomotivemtl/charcoal-admin/issues/e9d29556820f0b2f4e6a6adc127c31dad86fae04) * **admin:** Improve validate/save in component_manager.js ([423c84b](423c84b)), closes [locomotivemtl/charcoal-admin#1759d2bb90297ff7f03c5c94a0211b22dd2796](https://github.com/locomotivemtl/charcoal-admin/issues/1759d2bb90297ff7f03c5c94a0211b22dd2796) [locomotivemtl/charcoal-admin#e5e0741666cb52ca84a09cabce6619a8ec61c7c2](https://github.com/locomotivemtl/charcoal-admin/issues/e5e0741666cb52ca84a09cabce6619a8ec61c7c2) ### Bug Fixes * **admin:** Add missing localizations ([9496922](9496922)), closes [locomotivemtl/charcoal-admin#47012a22e696bd090adb08ded9954ac1a50e84](https://github.com/locomotivemtl/charcoal-admin/issues/47012a22e696bd090adb08ded9954ac1a50e84) * **admin:** Ensure widgetL10n is available with attachment.js ([8cea251](8cea251)), closes [locomotivemtl/charcoal-attachment#496b9bec978bb01065e59c36e4291fe8e3384](https://github.com/locomotivemtl/charcoal-attachment/issues/496b9bec978bb01065e59c36e4291fe8e3384) * **admin:** Improve hasL10nFormProperties resolution ([3be40b0](3be40b0)), closes [locomotivemtl/charcoal-admin#2c4c3797bb8463241e723e6d157589291c832a0](https://github.com/locomotivemtl/charcoal-admin/issues/2c4c3797bb8463241e723e6d157589291c832a0) * **admin:** Improve internals of attachment.js ([a387db3](a387db3)), closes [locomotivemtl/charcoal-admin#45135ef015723f319ed246bf28eac4d4d2dccbe4](https://github.com/locomotivemtl/charcoal-admin/issues/45135ef015723f319ed246bf28eac4d4d2dccbe4) * **admin:** Improve resolveSimpleJsonXhr in charcoal.js ([1eee836](1eee836)), closes [locomotivemtl/charcoal-admin#bc8327e7aadeb57ea6e1ec931051aba4d630d409](https://github.com/locomotivemtl/charcoal-admin/issues/bc8327e7aadeb57ea6e1ec931051aba4d630d409) * **admin:** Update Bootstrap to v4.6.2 ([1fb8b4a](1fb8b4a)), closes [locomotivemtl/charcoal-admin#e6ac7b6f3b447cf08b7d9578b3d888d178a3639](https://github.com/locomotivemtl/charcoal-admin/issues/e6ac7b6f3b447cf08b7d9578b3d888d178a3639) * **property:** Fix parsing + error handling in Sprite Property ([831f16d](831f16d)), closes [locomotivemtl/charcoal-property#d1ef3c66122781581a856721fe233a816fc5b0b6](https://github.com/locomotivemtl/charcoal-property/issues/d1ef3c66122781581a856721fe233a816fc5b0b6) [locomotivemtl/charcoal-property#8f3403145b55c43190e447dae1c8f4dea249cc33](https://github.com/locomotivemtl/charcoal-property/issues/8f3403145b55c43190e447dae1c8f4dea249cc33) ### Performance Improvements * **admin:** Fix and improve event namespacing in JS components ([db46534](db46534)), closes [locomotivemtl/charcoal-admin#738ae375ed4fa92cdd2ddbdadb2dca3cab8bbe96](https://github.com/locomotivemtl/charcoal-admin/issues/738ae375ed4fa92cdd2ddbdadb2dca3cab8bbe96) * **admin:** Improve elements in form.js and quickform.js ([81b9cad](81b9cad)), closes [locomotivemtl/charcoal-admin#bee1d393d313fdfc0a8b9a5918a7678a46b33d21](https://github.com/locomotivemtl/charcoal-admin/issues/bee1d393d313fdfc0a8b9a5918a7678a46b33d21) * **admin:** Improve internals of feedback.js ([cb6a4f6](cb6a4f6)), closes [locomotivemtl/charcoal-admin#45b76606fc945ab2526ccdd9db8219b11fb8ca10](https://github.com/locomotivemtl/charcoal-admin/issues/45b76606fc945ab2526ccdd9db8219b11fb8ca10) * **export:** improve performance of exporter ([9a1de4c](9a1de4c)), closes [locomotivemtl/charcoal-admin#19192817861a2faed50ad7aeb8b10dfbcc63ce25](https://github.com/locomotivemtl/charcoal-admin/issues/19192817861a2faed50ad7aeb8b10dfbcc63ce25) ### Reverts * **admin:** Disable `will_save` constraint in attachment.js ([3e78bcd](3e78bcd)), closes [locomotivemtl/charcoal-admin#1759d2bb90297ff7f03c5c94a0211b22dd2796](https://github.com/locomotivemtl/charcoal-admin/issues/1759d2bb90297ff7f03c5c94a0211b22dd2796) [locomotivemtl/charcoal-admin#6fb62c401db2192693d09cd42b8b2250d7af57b6](https://github.com/locomotivemtl/charcoal-admin/issues/6fb62c401db2192693d09cd42b8b2250d7af57b6) ### Code Refactoring * Integration of Attachment widget data and options ([c24ebc7](c24ebc7)), closes [locomotivemtl/charcoal-attachment#994dcc357626c0fd716b864812dffdc1ca742d93](https://github.com/locomotivemtl/charcoal-attachment/issues/994dcc357626c0fd716b864812dffdc1ca742d93)