summaryrefslogtreecommitdiff
path: root/addons/mail_bot/static
AgeCommit message (Collapse)Author
2020-08-28[FIX] mail, *: fix opens and redirects, adapt messaging menu closeSébastien Theys
task-2244279 task-2262862 task-2274993 task-2277537 task-2282238 closes odoo/odoo#56745 X-original-commit: 109f202 Related: odoo/enterprise#12761 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-26[IMP] mail, mail_bot: move notif request and OdooBot name into mailDidier (did)
task-2282334 closes odoo/odoo#56584 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-08-13[IMP] web, *: improve mock server and replace most mail mockRPCSébastien Theys
Improve mock server: - add support for mocked `fetch` - add support for `active_test` - add support for x2m `in` in domains - add support for default values computed from a function - implement a more natural "next id" compute - allow initial data without ids - ensure write and x2m commands integrity - improve bad data/bad commands error messages - always warn for failing RPC, not only in debug mode - fix all existing tests that had inconsistency data Other changes done in mail (or dependents) that are not just related to tests: - remove `direct_partner` from formatter result ->`correspondent` can be computed from other keys, especially `members` - fix `livechat_visitor` convertData -> only process if there is value - add `current_partner` and `current_user_id` as `init_messaging` result -> easier to mock than session - remove usage of `need_moderation` -> that was just a search indirection to `moderation_status` - adapt `partner_id` -> `res_partner_id` key in `_notification_format` -> to be consistent with field name - add name in result of `mail_partner_format` -> sometimes display_name is not the same - remove usage of `is_moderator` -> that was just an indirection to `moderation_channel_ids` Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523 task-2287171 closes odoo/odoo#55854 X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d Related: odoo/enterprise#12391 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-06-25[FIX] mail_bot: fix OdooBot not startingSébastien Theys
- fix initializer start override (typo in method name) - properly wrap async code in models - disable OdooBot for System user - use existing python method to create chat task-2284584 closes odoo/odoo#53669 X-original-commit: 47bbfeab9e238ab542d16bf4ed17d60ad6aea50d Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-15[REF] mail, *: refactor messaging with OWLSébastien Theys
This commit is a significant rewriting of client-side discuss, chatter, chat window, and messaging menu using OWL. The behavior should be broadly the same, with some slight functional changes here and there. From a technical standpoint, the code of messaging is mainly organized in 2 main groups of modules: - models, which are logical entities that depict the client-side state of messaging as a whole. - components, which are in charge of displaying information from models. This refactoring also introduces new JS guidelines regarding folder structure (/static) and naming rules for JS modules. Community PR: https://github.com/odoo/odoo/pull/39023 Enterprise PR: https://github.com/odoo/enterprise/pull/6249 Task-1914207 This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier, with the precious help of Lucas to speed it up towards the end. closes odoo/odoo#39023 Related: odoo/enterprise#6249 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Co-authored-by: Alexandre Kühn <aku@odoo.com> Co-authored-by: Julien Giannone <jgi@odoo.com> Co-authored-by: Lucas Perais <lpe@odoo.com> Co-authored-by: Sébastien Theys <seb@odoo.com> Co-authored-by: Xavier Dubuc <xdu@odoo.com>
2020-05-27[IMP] mail_bot: improve OdooBot workflowdmonzonis
This commit attempts to improve the workflow of the OdooBot onboarding tutorial, as well as the answer given by the bot while idle. These changes come from watching how users interact with OdooBot. To improve the user's experience, the following changes have been made: 1. Move the attachment to the end of the tour, as it is where most people just close the bot. 2. Remove the quotation marks around commands that OdooBot tells the user to type, like "/" or ":)", as some users try to actually type the quotation marks too. Instead, use a light grey background around the command that the user should type. 3. Some users ask OdooBot questions, but the responses they get are useless. To solve this, use a message linking to the documentation or the videos when: - The user gives wrong answers twice for the same stage of the tour - The user talks again when the tour is completed - There's a question mark in the answer To achieve this a "failed" state field is added on user model, allowing to distinguish state in the bot workflow from state of answers (failed / not failed). Task ID: 2233014 PR #49661
2020-03-13[REF] *: Adapt all module tests to the new control panelJulien Mougenot
Use of the new control panel helpers to increase consistency and change the assertions according to the new DOM/behaviour (e.g. components removed instead of turning invisible). Part of task 2196029 Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-11[FIX] mail_bot: revert of notification request changeSébastien Theys
Commit [1] does not work as it is supposed to, because there has been a confusion between the "notification request" and the "chat with OdooBot". `_showOdoobotTimeout` is for the chat, and it is unrelated to the notification request. We don't want to initiate multiple chats with OdooBot so that has to be reverted. As for the original goal of the PR about the notification request, it wasn't met either because it is the browser controlling it: - on Firefox there simply isn't a "close" button, and closing it by any other means (escape key) is considered as a denied. - on Chrome, when closing it for the first time, it will appear again automatically after the next page reload, so no additional code is required. However, if it is closed too many times (around 3) it will become automatically denied too, at the browser level. The only thing to do at that point is to better notify the user that it was blocked, without being intrusive, which is the focus of task-2188584. [1] b7254ecaeee7f8fa564ca2059f119f5d12404af6 opw-2186299 closes odoo/odoo#47395 X-original-commit: 50155e808c44121086cc7436cec0e7f166cd4268 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-03-03[FIX] mail_bot: odoobot waits 1 week between notification requestsjerome hanke (jhk)
Steps to reproduce: - install mail_bot - wait for odoobot to ask you if you want to receive notifications - do not select "grant" or "deny", click the closing cross Previous behavior: Odoobot would consider that you denied the request Current behavior: Odoobot waits 1 week and will ask you again opw-2186299 closes odoo/odoo#46697 X-original-commit: b7254ecaeee7f8fa564ca2059f119f5d12404af6 Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2019-03-06[REF] mail_bot: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-15[IMP] mail_bot: Blocked notification alert to UserJuhil Somaiya
If user has blocked odoo push notifications then there's no way to enable via the OdooBot notification in the systray as it depends on the navigator so display the alert message under users preference section. Related Task ID: 1929547 closes odoo/odoo#30496
2019-01-09[MERGE] forward port branch 12.0 up to 3e4138deaa2Christophe Simonis
closes odoo/odoo#30045
2018-12-17[FIX] mail_bot: hide Odoobot request when denied (Firefox)Alexandre Kühn
Before this commit, the notification "Odoobot has a request" would stay on screen even though the user blocked them in Firefox. This case occurred when the user clicks on "Not Now", which tells the browser that the push notifications should be blocked until the next page reload. This commit fixes this issue, so that the notification is removed when clicking on "Not Now", in addition to cleaning tests related to push notifications. Task-ID 1918476 closes odoo/odoo#29584
2018-12-06[IMP] bus, mail, mail_bot: improved native notificationAlexandre Kühn
With this commit, no push notification is sent to user when to acknowledge that he just has accepted them. Also, on native push notifications, the Odoo Bot icon now has a transparent background. Task-ID 1881001
2018-11-19[REF] *: update js test suite to use helpersGéry Debongnie
This rev. introduces robust helpers to use in the JS tests suite to interact with DOM and components, and starts using them (almost) everywhere. All the helpers are exposed though testUtils.js. There are 2 kinds of helpers: 1. Assertions ------------- * assert.containsNone, containsN, containsOnce check that the DOM (or a specific part of the DOM) contains a `selector`. It generates a correct error message automatically. ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg"); -> assert.containsOnce(form, '.o_form_editable'); * assert.isVisible, isNotVisible check that the DOM has an element visible or not. They also check that the element is actually in the DOM (before most tests didn't verify this). * assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific properties of a DOM element, and also validate that it is applied on a single existing DOM element (before most tests didn't verify this). ex: assert.notOk(form.$('button').hasClass('btn-primary')); -> assert.doesNotHaveClass(form.$('button'), 'btn-primary'); 2. Utilities ------------ The goal of the utilities is to centralize the definition of many standard components and interactions, ensuring that when we refactor the JS framework, we do not need to change all the tests. Existing mock utilities (addMockEnvironment, intercept, path, patchDate, unpatch and fieldsViewGet) are moved to 'testUtils.mock.*'. Existing DOM utilities are moved to 'testUtils.dom.*'. New dom utilities are created for opendDatePicker, click, clickFirst and clickLast. Helper `click` verifies that there is exactly 1 element visible in the DOM you click on, `clickFirst` and `clickLast` verify that there are more than one element on the DOM. ex: form.$('button').click(); -> testUtils.dom.click(form.$('button')); New Form utilities: (testUtils.form.*) clickEdit, clickSave, clickCreate, clickDiscard, all clicks on the control panel buttons of the form. `reload` reloads the form data. New modal, graph, kanban and pivot utils (testUtils.pivot.*, testUtils.kanban.*, etc.). New fields utils: (testUtils.fields.*) * editInput, editSelect: allow to change the value of a field, using a selector to identify it. They validate that the input exists and trigger the change event automatically. * editAndTrigger: allow to modify a field and trigger specific events after the value change * many2one (testUtils.fields.many2one.*) clickOpenDropdown, clickHighlightedItem, clickItem, searchAndClickItem: use a field name instead of a selector and do all the complex mechanism to open, filter and highlight many2one fields. Joint work with aab, dam, ged, mge, svs and vsc.
2018-08-30[IMP] mail, mail_bot: improved push notifications permission responseAlexandre Kühn
This commit makes small improvements on the messaging menu with the new module `mail_bot`: [IMP] When OdooBot has a request, it now adds "+1" to the counter of the messaging menu. The related preview also has a bold title, and displays "(1)" next to the title. [REF] Static previews are no longer in mail_service. This was only used for "OdooBot has a request" preview. This logic has now been moved to the module `mail_bot` (was previously in `mail`). [FIX] Title of response of push notifications permission clearly states whether permission has been granted or denied (was displaying "[Object object]" before this commit). Task-ID 1877502
2018-08-17[IMP] mail_bot: improve answers, initialisation and othersXavierDo
1. Odoobot shouldn't talk to admin when demo data are installed Odoobot will talk to a user on it's first connection, meaning that a dev will see this chat window a lot. The state disabled is not a real state but is explicit, the odoobot wont be initialized in this case. It is still possible to test odoobot flow with demo user. 2. remove old odoobot image and update link 3. small improvements in odoobot answers
2018-08-10[ADD] mail_bot, im_livechat_mail_bot: add Odoobot, your new best friendXavierDo
Purpose of this commit is to improve onboarding with a wow effect and a bot to test the Discuss app. Otherwise new users have nobody to talk to. Retention will be improved by both increasing interactions and onboarding of Discuss features. This commit adds a simple bot in discuss. It answers some questions, helps users getting their hand on discuss and eases the onboarding. In this version, the flow is quite simple, and only im_livechat adds some logic in order to show canned response. The logic is contained in new modules: mail_bot and im_livechat_mail_bot in order to keep everything well separated. It also allows users to remove the mailbot if they do not want to keep this functionality. Odoobot will only answer if he is in the onboarding conversation (alone with a user in a channel of type chat) or if a user pings odoobot. Odoobot logic applies to both standard chatter / channel messages and also transient messages (like help commands). Specifications * 2 minutes after first sign in, users will receive a direct chat from Odoobot; * make Odoobot an archived partner; * scenario * Odoobot: "Hello, I'm here to help you discover chat features. Try answering me with an emoji :)"; * User: Send emoji * Odoobot: "Great! :) Did you notice that you can also send attachments, like a picture of your cute dog? Try it!" * Odoobot: "Not a cute dog, but you get it :) To access special features, start your sentence with "/" (I.E. /help)"" * User: /help * Auto message then Odoobot: "Wow you're a natural! As a channel usually contain a lot of users, you can grab the attention with a ping. Try to ping me with @Odoobot!" * User: @Odoobot lorem ipsum * if Livechat installed * add 2 demo canned response so it does not look weird (like "Hello, how may I help you?" and "Have a nice day!") * Odoobot: "Perfect! <br> Try to type ":" to use canned responses." * User tries canned * Odoobot: "Good, you can customize your canned responses in the live chat application. <br><br> + réponse suivante" * Odoobot: "There's 3 different ways in Odoo to interact with your colleagues: via this chat window, [img of chat window] via the Discuss application [img of Discuss app + icon on it] or via the chatter [img of the chatter]. Aaaaand that's it! Enjoy discovering Odoo! :)" * random answers to ping/bad answer * "Mmmmh I'm not sure what you mean.. Can you try again?" * "I'm afraid I don't understand. Sorry!" * when someone pings @OdooBot with no reason: Odoobot: Yaaaay that's me! [party emoji] * fun stuff to add for some answer * User: i love you / love * Odoobot: Aaaaaw that's really cute but, you know, bots don't work that way. You're too human for me! Let's keep it professional <3 * User: Fuck * Odoobot: That's not a really nice thing to say, you know? I'm a bot but I have feelings, ok?! </3 This commit is linked to task ID 1838588 and PR #25075.