OCA / web

Odoo web client UI related addons
GNU Affero General Public License v3.0
912 stars 1.86k forks source link

[16.0][IMP] web_timeline: Overflow text, add hover colors #2775

Closed houzefa-abba closed 5 months ago

houzefa-abba commented 5 months ago

When an item label does not fit in its date-range box, overflow according to https://visjs.github.io/vis-timeline/examples/timeline/items/rangeOverflowItem.html

Previous CSS code was already trying to do that, but was selecting .vis-item.vis-item-content instead of .vis-item .vis-item-content.

Displaying overflow text brings up layout issues solved by removing the forced-100% width instruction.

This change also adds highlight when hovering a box, which is useful on text that has overflown (as it has no borders).

In screenshots below I added an end date close to the start date on the first 2 tasks. They almost have the same dates, to make sure the vis lib handles them correctly (they don't step on each other).

Before: labels cut

Screenshot at 2024-03-21 11-47-11

After: labels overflow

Screenshot at 2024-03-21 11-35-10

With hover highlight

Screenshot at 2024-03-21 11-35-30

OCA-git-bot commented 5 months ago

Hi @tarteo, some modules you are maintaining are being modified, check this out!

pedrobaeza commented 5 months ago

Well, if rebased after #2776, on the cron view

houzefa-abba commented 5 months ago

Hi rebase is done

The demo cron view uses single points, so it allows testing hover highlight color but not text overflow: Screenshot at 2024-04-04 09-50-57

I then edited the "ir.cron timeline" view on runboat to change:

date_start="nextcall"

to:

date_start="create_date" date_stop="nextcall"

Now items are displayed with range boxes instead of single points, and we can see text overflow works: Screenshot at 2024-04-04 09-49-55

Before this PR, the "Mail: Fetchmail Service" text for example would be completely invisible as its range box is so small

OCA-git-bot commented 5 months ago

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

pedrobaeza commented 5 months ago

/ocabot merge patch

OCA-git-bot commented 5 months ago

What a great day to merge this nice PR. Let's do it! Prepared branch 16.0-ocabot-merge-pr-2775-by-pedrobaeza-bump-patch, awaiting test results.

OCA-git-bot commented 5 months ago

Congratulations, your PR was merged at d891f17f5c9389075b9752a7f5c859bb1762284d. Thanks a lot for contributing to OCA. ❤️