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

[IMP] web, *: calendar view UI #30469

Open
wants to merge 9 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@mge-odoo
Copy link
Contributor

mge-odoo commented Jan 23, 2019

No description provided.

@robodoo robodoo added the seen 🙂 label Jan 23, 2019

@mge-odoo mge-odoo force-pushed the odoo-dev:master-calendar-view-ref branch Jan 23, 2019

@C3POdoo C3POdoo added the RD label Jan 23, 2019

addons/web/static/src/js/views/calendar/calendar_renderer.js Outdated
@@ -78,7 +79,7 @@ var SidebarFilter = Widget.extend(FieldManagerMixin, {
{
mode: 'edit',
attrs: {
placeholder: _.str.sprintf(_t("Add %s"), self.title),
placeholder: _.str.sprintf(_t("+ Add %s"), self.title),

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

+ could be added outside of the _t

* @private
*/
_onToggleFullWidth: function () {
this.model.toggleFullWidth();

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

I don't understand why the toggleFullWidth feature has been removed ; it doesn't seem specified in the commit or the task.

addons/web/static/src/js/views/calendar/calendar_renderer.js Outdated
},
eventClick: function (event, jsEvent) {
self._disposePopovers();
self._renderPopover(event, $(jsEvent.currentTarget));

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

This jsEvent seems strange

addons/web/static/src/js/views/calendar/calendar_renderer.js Outdated
data.title = self.state.context.default_name;
// Clicking on the view, dispose any visible popover.
// Otherwise create a new event.
if (_.isElement($('.o_cw_popover')[0])) {

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

$() in the whole DOM is not ideal. Where is the popover? Can't we use this.$()? If not, we can maybe get a direct reference instead?

addons/web/static/src/js/views/calendar/calendar_renderer.js Outdated
data.title = self.state.context.default_name;
// Clicking on the view, dispose any visible popover.
// Otherwise create a new event.
if (_.isElement($('.o_cw_popover')[0])) {

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

_.isElement is also strange ; use $(selector).length instead.

addons/web/static/src/js/views/calendar/calendar_renderer.js Outdated
this._disposePopovers();
this._renderEvents();

_.defer(function () {

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

I don't like this ; no way to do something different?

@@ -20,6 +20,8 @@
<rng:optional><rng:attribute name="color" /></rng:optional>
<rng:optional><rng:attribute name="event_open_popup" /></rng:optional>
<rng:optional><rng:attribute name="js_class"/></rng:optional>
<rng:optional><rng:attribute name="hide_time"/></rng:optional>

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

This could be done in the same commit as the first one.

@@ -20,6 +20,8 @@
<rng:optional><rng:attribute name="color" /></rng:optional>
<rng:optional><rng:attribute name="event_open_popup" /></rng:optional>
<rng:optional><rng:attribute name="js_class"/></rng:optional>
<rng:optional><rng:attribute name="hide_time"/></rng:optional>
<rng:optional><rng:attribute name="hide_date"/></rng:optional>

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

Note that the doc on calendar should also be adapted to mention these two new attributes.

addons/hr_payroll/views/hr_benefit_views.xml Outdated
<field name="display_warning" invisible="1"/>
<!-- Sidebar favorites filters -->
<field name="employee_id" write_model="hr.user.benefit.employee" write_field="employee_id" avatar_field="image_small"/>
<templates>
<!-- <templates>

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

Why?

addons/web/static/tests/views/calendar_tests.js Outdated
@@ -312,7 +318,9 @@ QUnit.module('Views', {
$('.modal-footer button.btn:contains(Save)').trigger('click');

assert.notOk($('.modal-body').length, "save button should close the modal");
assert.ok(calendar.$('.fc-event:contains(event 4 modified)').length, "should display the updated records");

/// TODO: Temporary comment

This comment has been minimized.

@mge-odoo

mge-odoo Jan 24, 2019

Author Contributor

TODO

@jat-odoo jat-odoo force-pushed the odoo-dev:master-calendar-view-ref branch 8 times, most recently Jan 28, 2019

@robodoo robodoo added the CI 🤖 label Feb 1, 2019

@jat-odoo jat-odoo force-pushed the odoo-dev:master-calendar-view-ref branch to f426603 Feb 4, 2019

@robodoo robodoo removed the CI 🤖 label Feb 4, 2019

@jat-odoo jat-odoo force-pushed the odoo-dev:master-calendar-view-ref branch from f426603 to 5c610ec Feb 11, 2019

stefanorigano added some commits Dec 13, 2018

[REF] web: calendar view redesign
Refactor the calendar view, improving design and introducing
several usability improvements, in detail:

- Increase readability using a better colour selection.
- Add a popover containing all the fields specified in the
  <calendar/> element.
- Remove any field from the event card, just print the event’s
  title.

The new calendar popover consist in two sections.
The first one contains the title, date and time. It may display
also the field used to filter/assign colours (if it’s defined as
a <field> in the root <calendar> element).
Date and time are automatically computed according to the user
timing preferences, language and event duration.
Date and time can be hidden adding respectively the ‘hide_date’
and ‘hide_time’ attributes at the root <calendar/> element.

The second section is scrollable and contains all other fields
specified in the root <calendar/> element.

Task 1919926
[FIX] web: calendar, avoid flickering on filtering
The calendar view used to trigger a 'window.resize' to fit its container.
This was causing flickering issues, expecially using sidebar's filters.

This commit remove 'window.resize' and use the fullCalendar.js native
'render' method instead, forcing to (re)render the calendar widjet only.

Task 1919926

@jat-odoo jat-odoo force-pushed the odoo-dev:master-calendar-view-ref branch 3 times, most recently from e6dbe48 to 2367236 Feb 18, 2019

[IMP] web: Improve following:
- Improve previous code
- Add delete button in popover
- Adapt test cases

@jat-odoo jat-odoo force-pushed the odoo-dev:master-calendar-view-ref branch from 2367236 to 7839c78 Feb 18, 2019

@robodoo robodoo added the CI 🤖 label Feb 18, 2019

@robodoo robodoo removed the CI 🤖 label Feb 19, 2019

@jat-odoo jat-odoo force-pushed the odoo-dev:master-calendar-view-ref branch from be23dcc to bd9bff4 Feb 19, 2019

@robodoo robodoo added the CI 🤖 label Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment