summaryrefslogtreecommitdiff
path: root/addons/note/static
diff options
context:
space:
mode:
Diffstat (limited to 'addons/note/static')
-rw-r--r--addons/note/static/src/js/systray_activity_menu.js (renamed from addons/note/static/src/js/systray.js)14
-rw-r--r--addons/note/static/src/scss/note.scss8
-rw-r--r--addons/note/static/src/xml/systray.xml12
-rw-r--r--addons/note/static/tests/systray_activity_menu_tests.js (renamed from addons/note/static/tests/systray_tests.js)16
4 files changed, 25 insertions, 25 deletions
diff --git a/addons/note/static/src/js/systray.js b/addons/note/static/src/js/systray_activity_menu.js
index 54a2fe6bdd1..8194cc17e6a 100644
--- a/addons/note/static/src/js/systray.js
+++ b/addons/note/static/src/js/systray_activity_menu.js
@@ -1,8 +1,9 @@
-odoo.define('note.systray', function (require) {
+odoo.define('note.systray.ActivityMenu', function (require) {
"use strict";
+var ActivityMenu = require('mail.systray.ActivityMenu');
+
var core = require('web.core');
-var ActivityMenu = require('mail.systray').ActivityMenu;
var datepicker = require('web.datepicker');
var _t = core._t;
@@ -24,8 +25,10 @@ ActivityMenu.include({
*/
_getActivityData: function () {
var self = this;
- return this._super.apply(this, arguments).then(function() {
- var reminderIndex = _.findIndex(self.activities, function (val) { return val.model == 'note.note'; });
+ return this._super.apply(this, arguments).then(function () {
+ var reminderIndex = _.findIndex(self.activities, function (val) {
+ return val.model === 'note.note';
+ });
if (reminderIndex > 0) {
self.activities.splice(0, 0, self.activities.splice(reminderIndex, 1)[0]);
}
@@ -60,7 +63,7 @@ ActivityMenu.include({
*/
_onActivityFilterClick: function (ev) {
var $el = $(ev.currentTarget);
- if(!$el.hasClass("o_note")) {
+ if (!$el.hasClass("o_note")) {
var data = _.extend({}, $el.data(), $(ev.target).data());
if (data.res_model === "note.note" && data.filter === "my") {
this.do_action({
@@ -90,7 +93,6 @@ ActivityMenu.include({
this.noteDateTimeWidget.$input.attr('placeholder', _t("Today"));
this.$('.o_note_show, .o_note').toggleClass('hidden');
this.$('.o_note_input').val('').focus();
-
},
/**
* When focusing on input for new quick note systerm tray must be open.
diff --git a/addons/note/static/src/scss/note.scss b/addons/note/static/src/scss/note.scss
index 428c58ec28e..f1e90d80d57 100644
--- a/addons/note/static/src/scss/note.scss
+++ b/addons/note/static/src/scss/note.scss
@@ -25,11 +25,11 @@
}
// Quick create notes from systray
-.o_note.o_mail_channel_preview {
+.o_note.o_mail_preview {
background-color: white;
- .o_channel_info {
- .o_channel_title {
- .o_channel_name {
+ .o_preview_info {
+ .o_preview_title {
+ .o_preview_name {
@include o-flex(1, 1, 100%);
}
}
diff --git a/addons/note/static/src/xml/systray.xml b/addons/note/static/src/xml/systray.xml
index 827bf0159a8..d1676c63761 100644
--- a/addons/note/static/src/xml/systray.xml
+++ b/addons/note/static/src/xml/systray.xml
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
- <t t-extend="mail.chat.ActivityMenuPreview">
+ <t t-extend="mail.systray.ActivityMenu.Previews">
<t t-jquery="t[t-foreach*='activities'][t-as*='activity']" t-operation="after">
<div class="o_note_show">
<a role="button" class="btn btn-block text-center">Add new note</a>
</div>
- <div class="o_note o_mail_channel_preview hidden">
- <div class="o_mail_channel_image o_mail_channel_app">
+ <div class="o_note o_mail_preview hidden">
+ <div class="o_mail_preview_image o_mail_preview_app">
<img src="/note/static/description/icon.png" alt="Channel"/>
</div>
- <div class="o_channel_info">
- <div class="o_channel_title">
- <span class="o_channel_name"><strong>Add a note</strong></span>
+ <div class="o_preview_info">
+ <div class="o_preview_title">
+ <span class="o_preview_name"><strong>Add a note</strong></span>
<div class="o_note_datetime"/>
<span class="ml4">
<a class="o_note_set_datetime text-muted">
diff --git a/addons/note/static/tests/systray_tests.js b/addons/note/static/tests/systray_activity_menu_tests.js
index 4cae5799fbb..adf6fcd9bf5 100644
--- a/addons/note/static/tests/systray_tests.js
+++ b/addons/note/static/tests/systray_activity_menu_tests.js
@@ -1,16 +1,16 @@
-odoo.define('note.systray_tests', function (require) {
+odoo.define('note.systray.ActivityMenuTests', function (require) {
"use strict";
-var ChatManager = require('mail.ChatManager');
-var systray = require('mail.systray');
+var ActivityMenu = require('mail.systray.ActivityMenu');
+var mailTestUtils = require('mail.testUtils');
+
var testUtils = require('web.test_utils');
-var createBusService = require('mail.testUtils').createBusService;
QUnit.module('note', {}, function () {
QUnit.module("ActivityMenu", {
beforeEach: function () {
- this.services = [ChatManager, createBusService()];
+ this.services = mailTestUtils.getMailServices();
this.data = {
'mail.activity.menu': {
records: [],
@@ -22,7 +22,7 @@ QUnit.module("ActivityMenu", {
QUnit.test('note activity menu widget: create note from activity menu', function (assert) {
assert.expect(8);
var self = this;
- var activityMenu = new systray.ActivityMenu();
+ var activityMenu = new ActivityMenu();
testUtils.addMockEnvironment(activityMenu, {
services: this.services,
mockRPC: function (route, args) {
@@ -36,10 +36,9 @@ QUnit.test('note activity menu widget: create note from activity menu', function
},
});
activityMenu.appendTo($('#qunit-fixture'));
- assert.ok(activityMenu.$el.hasClass('o_mail_navbar_item'), 'should be the instance of widget');
+ assert.ok(activityMenu.$el.hasClass('o_mail_systray_item'), 'should be the instance of widget');
// toggle quick create for note
- var step = 1;
activityMenu.$('.dropdown-toggle').click();
assert.strictEqual(activityMenu.$('.o_note_show').hasClass("hidden"), false, 'ActivityMenu should have Add new note CTA');
activityMenu.$('.o_note_show').click();
@@ -53,7 +52,6 @@ QUnit.test('note activity menu widget: create note from activity menu', function
assert.strictEqual(activityMenu.$('.o_note').hasClass("hidden"), true, 'ActivityMenu add note input should be hidden');
// creating quick note with date
- step = 2;
activityMenu.$('.o_note_show').click();
activityMenu.$('input.o_note_input').val("New Note");
activityMenu.$('.o_note_set_datetime').click();