View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 16702 | Bug reports | Survey editing | public | 2020-09-28 12:41 | 2021-02-04 12:53 |
| Reporter | ollehar | Assigned To | ollehar | ||
| Priority | none | Severity | feature | ||
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 4.x.0-dev | ||||
| Summary | 16702: Replace VueJS top-bar with Yii widget | ||||
| Description | Alternatives:
Some brainstorming being done. https://www.yiiframework.com/doc/api/1.1/CMenu Personally I am not a fan of using associative arrays as data carriers. I don't believe they scale well in huge projects. Alternative to 4 is casting plugin Menu objects to arrays that CMenu can understand. Like The top-bar should do only one thing - display buttons that are fed to it. the different types of buttons (or widgets, since condition designer also has a question selector) correspond to different classes carrying the data. the mapping from object data to HTML is done in the widget view files. E.g., if you have a DropDownMenu class, then you'll have a dropdownmenu.php view file in the widget. So in the controller view you end up with
Branch: feature/16702-replace-vuejs-topbar-with-widget | ||||
| Tags | No tags attached. | ||||
| Bug heat | 8 | ||||
| Complete LimeSurvey version number (& build) | |||||
| I will donate to the project if issue is resolved | |||||
| Browser | |||||
| Database type & version | |||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | |||||
| Git branch / Pull Request URL | |||||
| related to | 16784 | closed | gabrieljenik | Top-bar missing buttons when adding new question group |
|
@DenisChenu Time to review? |
|
|
Not sure how to make CMenu play well with Bootstrap. Edit: Answer: htmlOptions => [class => btn] Edit 2: But HTML structure is different than CMenu. Edit 3: Can use item templates for this. ^^ |
|
|
Example (unfinished) implementation using CMenu:
Problems: How to implement Bootstrap HTML structure? How to replace anchor with button tag for dropdown menu? |
|
|
I like CMenu. I haven't used it in a while. Still some comments.
As for the question selector, we could use a custom rendered and in there make a query for fetching the questions. Then we would minimize the data passed as parameters. I would dig a little bit more on the cMenu and look for examples with permission checking. |
|
|
CMenu test here: https://github.com/LimeSurvey/LimeSurvey/commit/1f29debbd7fb03635b1f1140789dc8691d3b9533 Someone will have to try to get this to work. Otherwise, I vote against. |
|
I should write an article about this, but with objects you can do:
There's no performance difference between arrays and objects in PHP. Arrays have value semantics, objects are passed as references. |
|
|
"PHP: Use associative arrays basically never": https://steemit.com/php/@crell/php-use-associative-arrays-basically-never
But also:
|
|
|
I don't really care on the final solution ;) But something that can be extendable … or user manageable … Create our own widget (or extende CMenu) based on https://github.com/LimeSurvey/LimeSurvey/tree/master/application/libraries/MenuObjects ? |
|
|
Yes, my widget uses the same classes as the ones for the plugins - Menu and MenuItem (and others inherited from those). |
|
|
@gabrieljenik Can you push the code you made, too, using CMenu? So it can be reviewed. :) |
|
|
|
|
Nicely done, Gabriel! However, one problem I see with this approach is that HTML ends up in strings among programming logic. Is it possible to move Another alternative would be to have a new class "CMenuItem` that implements ArrayAccess interface. This way, we could get rid of long, associative arrays. |
|
:+1: It can be really great :) |
|
|
@ollehar, Yes this need improvement. We were just doing it as a Proof of Concept for the dropdowns. |
|
|
@gabrieljenik The thing is, as you work through this, I think in the end you will re-implement the solution I already did with CWidget. :) Which has classes and view files. |
|
|
Well... that could be true... :) Not sure how much advanced is that solution, but both go in the same direction. |
|
|
We'll discuss in the team and let you know. Thanks! |
|
|
Seems like we can't agree right now, so we'll go back to LS3 style, with buttons in view files. No widget. |
|
|
Good. Will adapt question groups toolbars and others from the screens I ported |
|
|
Related discussion of my attempt: https://forum.yiiframework.com/t/renderobjectasviewwidget/130644 |
|
|
Notes from Patricia: We decided to use the topbar from LS3 (in conception meeting) in first step. in an action there must be the line: Advantages: |
|
|
Any branch where we can see an example? |
|
|
Ping @pstelling |
|
|
it's in the branch "https://github.com/LimeSurvey/LimeSurvey/tree/task/zoho-L41-T55-topbar-copy-question" ping @gabrieljenik |
|
|
Hi @pstelling Thanks for the code. On the second screenshot we can see everything makes sense as the layout is different. Thoughts? |
|
|
Hi Gabriel, thanks for the hint. Yes obviously there is a problem when rendering something with Ajax Request. Did you change/implement the topbar in "Edit email templaztes"? Bye |
|
|
Yes, for email templates we created a top bar, copying it from LS3. We could actually add some stuff on it. But that's enhancements. Look forward to your comments on how to move forward. Thanks |
|
|
Hi Gabriel, thanks for your comment :). We had the idea to stay with the "design" (layout) for the topbar like it is in LS3. Would you like to have another design/layout for it? What would you prefer? What kind of "stuff" would you like to add? Enhancements are always good. Best when we get information about it. Would you like to write it (e.g. Buttons missing or would be nice to have the Button X ). Would also be nice to know the "intention" behind, like "having this button in addition gives us the possibility of ...". Of course there should not be two topbars (one behind the other, like in image2). Can you send me the link to the branch where you implemented the topbar for email templates? I'm looking forward to hear from you. Best regards |
|
I was referring to the email template toolbar, not the general toolbar system
Sorry, I missed the link on this ticket. Let me know if you want to hook into a call. Thanks! |
|
|
Added some code here: Don't kill me :)
Still, everything is overridable, so if we need a specific topbar for a single view, we can do that. Double topBars is solved. This a WIP, I am working on the surveyTopBar which is very general. |
|
+1, but i don't like I prefer params, @patricia start something here : https://github.com/LimeSurvey/LimeSurvey/blob/develop/application/views/admin/super/fullpagebar_view.php I use it in views (and adapt send button) |
|
Those kind of params are something to come. Definitely. That rightSideContent redended can be on top of a blankTopBar or on top of a shared top bar with some default buttons already. |
|
|
I think it's totally related to the Menu project from @ollehar too. Finally : all top tools are menu … |
|
|
I think it is the same! |
|
|
Turned configuration into a class and rendering enclosed into a widget: |
|
|
Merged to DEV. |
|
|
Some extra comments: On LS3 ckeditor configuration wrapper and utilities were coded in a way that sometimes the textarea (and control) was fecthed by name and sometimes by id, using a single value for fecthing using name or id criteria. Something like GetByName(YXZ) or GetById(YXZ). On LS4 textareas can have different name and id. Which is good. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2020-09-28 12:41 | ollehar | New Issue | |
| 2020-09-28 12:41 | ollehar | Description Updated | |
| 2020-09-28 12:42 | ollehar | Description Updated | |
| 2020-09-28 12:42 | ollehar | Description Updated | |
| 2020-09-28 12:44 | ollehar | Description Updated | |
| 2020-09-28 12:44 | ollehar | Description Updated | |
| 2020-09-28 15:31 | ollehar | Description Updated | |
| 2020-09-29 11:49 | ollehar | Description Updated | |
| 2020-09-29 11:53 | ollehar | Note Added: 59977 | |
| 2020-09-29 12:09 | ollehar | Description Updated | |
| 2020-09-29 12:24 | ollehar | Assigned To | => ollehar |
| 2020-09-29 12:24 | ollehar | Status | new => assigned |
| 2020-09-29 12:54 | ollehar | Note Added: 59978 | |
| 2020-09-29 13:11 | ollehar | Note Edited: 59978 | |
| 2020-09-29 13:21 | ollehar | Note Edited: 59978 | |
| 2020-09-29 13:54 | ollehar | Note Edited: 59978 | |
| 2020-09-29 14:55 | ollehar | Description Updated | |
| 2020-09-29 15:11 | ollehar | Note Added: 59979 | |
| 2020-09-29 15:20 | gabrieljenik | Note Added: 59980 | |
| 2020-09-29 15:24 | ollehar | Note Added: 59981 | |
| 2020-09-29 15:30 | ollehar | Note Added: 59982 | |
| 2020-09-29 15:30 | ollehar | Note Edited: 59981 | |
| 2020-09-29 15:41 | ollehar | Note Edited: 59982 | |
| 2020-09-29 16:01 | ollehar | Note Added: 59983 | |
| 2020-09-29 16:05 | ollehar | Note Edited: 59983 | |
| 2020-09-29 16:06 | ollehar | Note Edited: 59983 | |
| 2020-09-29 16:06 | ollehar | Note Edited: 59982 | |
| 2020-09-30 15:15 | DenisChenu | Note Added: 59994 | |
| 2020-09-30 15:15 | DenisChenu | File Added: Capture d’écran du 2020-09-30 15-12-51.png | |
| 2020-09-30 16:10 | ollehar | Note Added: 59995 | |
| 2020-10-01 10:19 | ollehar | Note Added: 59999 | |
| 2020-10-01 14:29 | gabrieljenik | Note Added: 60016 | |
| 2020-10-01 14:29 | gabrieljenik | File Added: image.png | |
| 2020-10-01 14:30 | gabrieljenik | Note Edited: 60016 | |
| 2020-10-01 14:38 | ollehar | Note Added: 60020 | |
| 2020-10-01 14:42 | DenisChenu | Note Added: 60024 | |
| 2020-10-01 15:49 | gabrieljenik | Note Added: 60030 | |
| 2020-10-01 15:50 | ollehar | Note Added: 60031 | |
| 2020-10-01 16:12 | gabrieljenik | Note Added: 60032 | |
| 2020-10-01 16:13 | gabrieljenik | Note Edited: 60032 | |
| 2020-10-01 16:14 | ollehar | Note Added: 60033 | |
| 2020-10-02 12:27 | ollehar | Note Added: 60047 | |
| 2020-10-02 14:54 | gabrieljenik | Note Added: 60054 | |
| 2020-10-02 14:55 | ollehar | Note Added: 60055 | |
| 2020-10-14 11:18 | ollehar | Description Updated | |
| 2020-10-20 13:27 | ollehar | Note Added: 60302 | |
| 2020-10-20 13:28 | ollehar | Project | Feature requests => @10@ |
| 2020-10-21 00:46 | gabrieljenik | Note Added: 60321 | |
| 2020-10-21 14:08 | ollehar | Note Added: 60332 | |
| 2020-10-22 11:21 | pstelling | Note Added: 60352 | |
| 2020-10-28 14:06 | gabrieljenik | Relationship added | related to 16784 |
| 2020-10-28 14:22 | gabrieljenik | Note Added: 60444 | |
| 2020-10-28 14:22 | gabrieljenik | File Added: image-2.png | |
| 2020-10-28 14:22 | gabrieljenik | File Added: image-3.png | |
| 2020-10-28 20:37 | pstelling | Note Added: 60446 | |
| 2020-10-29 16:42 | gabrieljenik | Note Added: 60449 | |
| 2020-10-30 08:40 | pstelling | Note Added: 60450 | |
| 2020-10-30 13:23 | gabrieljenik | Note Added: 60462 | |
| 2020-11-06 19:58 | gabrieljenik | Note Added: 60584 | |
| 2020-11-08 15:16 | DenisChenu | Note Added: 60586 | |
| 2020-11-09 13:22 | gabrieljenik | Note Added: 60592 | |
| 2020-11-09 13:25 | DenisChenu | Note Added: 60593 | |
| 2020-11-09 13:39 | gabrieljenik | Note Added: 60594 | |
| 2020-12-03 16:28 | gabrieljenik | Note Added: 60823 | |
| 2020-12-30 13:18 | gabrieljenik | Note Added: 61318 | |
| 2020-12-31 14:06 | gabrieljenik | Note Added: 61388 | |
| 2021-02-04 12:53 | ollehar | Status | assigned => closed |
| 2021-02-04 12:53 | ollehar | Resolution | open => fixed |
| 2021-02-04 12:53 | ollehar | Fixed in Version | => 4.x.0-dev |