summaryrefslogtreecommitdiff
path: root/addons/website_links/static/src/js
AgeCommit message (Collapse)Author
2020-09-21[FIX] website_links: Crash when loading data more than a week oldnie
Steps to reproduce the bug: - Create old click data in the `link_tracker_click` table or change your computer's current date to two weeks in the future. - Go to the stats page of the link tracker Bug: Backtrace on the stats of the link tracker. opw:2321377 closes odoo/odoo#58110 X-original-commit: 875aeb5c55b96fc3f7d76fc67d56f60df8453ec3 Signed-off-by: Simon Goffin (sig) <sig@openerp.com> Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-07-27[FIX] website_links: prevent display of huge listNicolas Martinelli
- Create 80k UTM sources - Go to the Website - Promote a page (e.g. an event) - Select a source The web browser freezes. It happens because Select2 tries to display all sources at once. To prevent this, we force at least 3 characters before searching and hence displaying the results. Note that a such high number of UTM sources is reached because of automatic generation of random values in mass mailing. Therefore, the combination of 3 characters narrows down the search result drastically. opw-2289249 closes odoo/odoo#54947 X-original-commit: 7c7986361704d7b82b115499e64c47eb74ab655f Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-19[IMP] website_links: performance on search_readRémi Rahir
The widget Selectbo was performing a search_read on every field while only using the fields id and name. This search_read has become very costly in the latest version due to some new fields. We now limit the search_read to the useful fields. closes odoo/odoo#45707 X-original-commit: a4832ccdeedd777b43825e41ffb8c20937022279 Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2020-02-04[FIX] website_links: properly attach graph widgets to the hierarchyqsm-odoo
Simple `this` instead of `self` mistake which prevents the widgets to trigger up events. closes odoo/odoo#44617 X-original-commit: 033ad6680794e037566720f35b0285e18f3d2130 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-02[REF] website_links: set is_website to True on the campaignqmo-odoo
PURPOSE This commit removes the mass_mailing.campaign model. Instead of having a fully fledged model, we will simply inherit utm.campaign. We will also add relevant statistics on utm campaign model in order to use it in various applications. SPECIFICATIONS This commit changes website_links.js so that, when creating a campaign, the field is_website is set to true. This will allow us to filter irrelevant campaigns in mass_mailing and social Task ID: 2002029 PR: #34015
2019-06-06[MERGE] forward port branch saas-12.3 up to 409679866b2Christophe Simonis
2019-06-03[MERGE] forward port branch saas-12.2 up to 995aa1685eeChristophe Simonis
2019-06-05[IMP] *: move test and tour files to new folder hierarchy and assetRomain Derie
As we now have a new debug mode 'tests' which load a new asset bundle containing tour-test files, we moved those files to a new folder hierarchy. That will clean the .js files trees. Also, those files should be included in the new asset. Basically, the .js tour files (not test) should be inside /static/src/js/tours while .js tour test files (test=true) should be inside /static/tests/tours next to QUnit tests, inside a tours folder. + test_new_api: don't run the test in debug assets task-1934445 Comes with https://github.com/odoo/enterprise/pull/4281 Closes #33213
2019-05-23[FIX] website_links: fix url of the landing page in link trackerVarun Raval
The feature was broken by #28404 which made the JS make use of the "animations" system. Currently, on the website, we have an option 'Track this page' in promote section, which will give us the URL of the landing page. However, this option is not working and shows the default placeholder provided on the input. This commit will fix the issue. From now 'Track this page' option will get the URL of the landing page and it will be shown on input rather than the default placeholder value. task-1998160 closes #33603 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-18[FIX] website_links: fix remaining bugs and restore skipped testRomain Derie
This commit is following c78da8a80 that fixed website_links module. We had to merge it with a skipped test as there was an error only appearing with Docker (on runbot or on local with Docker). This commit fix that test error and some other remaining bugs not found during the first fix: 1. Fix the test error by adding a step to show recently used links. Indeed the bug was that newest links would return inconsistent order as both 2 links created during the steps have the same creation date. On runbot it would click on the wrong link, the one which has 0 clicks. Then JS would crash (see error bellow). 2. `websiteLinksCharts` JS animation class would execute all the `start` method code even if there was no `_totalClicks`. JS would then crash as `beginDate` would not be set correctly. Before the refactoring all that code would be skipped as surrounded by an if/else condition. 3. BS3 to BS4 broke the nav-tabs layout to switch between 'Newest, Most Clicked and Recently Used. `mt16` needed to be removed. Closes #31829
2019-04-01[IMP] *: use Chart.js in website_links/website_sale_link_tracker.Géry Debongnie
This commit is one part of the task 'removing nvd3'. We use now Chart.js to draw charts. Task ID: 1946138
2019-03-25[MERGE] forward port branch saas-12.2 up to 230ad8c381eChristophe Simonis
closes odoo/odoo#32088 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-13[MERGE] forward port branch saas-12.2 up to c9f832d9f03Christophe Simonis
closes odoo/odoo#31790 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-08[FIX] website_links: links fetching not workingToufik Ben Jaa
- The fetch of recently/most clicked links was not working due to the fact that the widget handling this feature had not parent, thus not having access to ajax.rpc to make rpc calls. closes odoo/odoo#31712 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06[REF] website_links: 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-03-11[FIX] website_links: fix multiple bugs + add testsRomain Derie
Commit 6d67ce5b7c refactored the JS from multiple website modules including `website_links`. A few error needed to be fixed: - recent links would not appear anymore - graphs would not be displayed anymore - graph resize on tab change would not be fired This commit fixes it and also add some tests to be sure this module is now strongly tested. Note: tests are skipped for now as there is a race condition happening only with docker and this fix is getting urgent for Odoo.com closes odoo/odoo#31507 Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-02-26[REF] website, *: use public widgets instead of website animationsqsm-odoo
* website_blog, website_crm_partner_assign, website_event, website_event_track, website_form, website_forum, website_links, website_mail, website_mail_channel, website_mass_mailing, website_sale, website_sale_comparison, website_sale_delivery, website_sale_stock, website_sale_wishlist, website_slides, website_twitter While using the 'Animation' class of website instead of the frontend 'Widget' class leads to the same behaviors, this refactoring is done for two reasons: - Stop using the confusing 'Animation' name for non-animated behaviors - Instantiation of 'Widget' is slightly faster than 'Animation' Part of https://github.com/odoo/odoo/pull/29442 task-1932066
2019-02-26[REF] website, *: move and review the notion of edit modeqsm-odoo
* portal, sale, web, website_blog, website_crm_partner_assign, website_forum, website_event_track, website_links, website_mail, website_slides, website_mail_channel, website_mass_mailing, website_sale, website_sale_comparison, website_sale_delivery, website_sale_wishlist The `editableMode` option and its related options in public widget should only be part of website, this commit moves them there. This is also the occasion to implement something that is long overdue: stop creating 'animations' / public widgets in edit mode by default. Indeed, lots of 'animations' were defined by beginning with 'if not edit mode'. Now, if a public widget should be considered in edit mode, it must be defined explicitely through a property at *definition* of the widget. Part of https://github.com/odoo/odoo/pull/29442 task-1932066
2018-11-28[REF] website_*: review reorganization and enforce conventionsqsm-odoo
Review the JS reorganization made by direct parent commits and do more to use our defined JS conventions. Also simplify JS which can be obviously improved.
2018-11-28[REF] website_links: reorganize javascriptAndrea Ulliana
2018-10-22[MERGE] forward port branch saas-11.4 up to 3c108977c1eChristophe Simonis
2018-10-11[MERGE] forward port branch 11.0 up to 717f4583949Christophe Simonis
2018-10-11[FIX] website_links: unreadable axis labels on statistics graphslen-odoo
When there are many values, the axis would be unreadable. We also added a margin so that the values would be displayed entirely, as opposed to cropped in the middle of a word. opw 1890109 closes odoo/odoo#27656
2018-09-30[REF] website, *: add automatic context for call_kw rpcqsm-odoo
* web_editor, website_blog, website_crm_partner_assign, website_links, website_livechat, website_mail_channel, website_mass_mailing, website_slides Calling a model's method thanks to an RPC will now always send the web_editor context automatically, making sure the method gets the website_id all the time, removing the need to guess the current website (now the get_current_website method uses the context website_id if any). Note: other routes already have the website_id via request.env.context if they correctly set website=True (this commit also adds website=True for scss files customization routes).
2018-08-06[FIX] ClipboardJS update for Bootstrap Modals focus issue in ChromeDavid Beguin
Since Bootstrap 4, ClipboardJS does not copy the value in the clipboard anymore as Bootstraps modals give the focus to another element. As the focus need to be given back to the correct element, ClipboardJS has to be updated as the container parameter is only added in v1.7. We were in 1.5. That container parameter allow to give the focus back to the correct element. See doc on https://clipboardjs.com/ + Issue : https://github.com/zenorocha/clipboard.js/issues/155
2018-01-16[REF] website_links: remove ZeroClipboard libAkash Bhavsar
... and use Clipboard instead, which is already in web (put in the assets_common). Task #33274
2017-08-16[REF] web_editor, website, *: complete refactoringqsm-odoo
* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour, website_blog, website_crm_partner_assign, website_event, website_event_questions, website_form, website_forum, website_gengo, website_hr_recruitment, website_links, website_mail, website_mail_channel, website_mass_mailing, website_quote, website_sale, website_sale_options, website_slides, website_twitter This commit reviews the whole "JS side" of the web_editor and website apps. This is a first step to be able to improve them with new and better functionnalities; this commit is not supposed to change any visual behavior. The main goal was to achieve a structure similar to the backend one. Now, the frontend side also has a root widget (like the WebClient) and all other widgets are attached to it one way or another. This allows the benefits of using the 'trigger_up' functionnality for example. As RPC are now mainly done with the `this._rpc` functionnality (being possible thanks to the parent hierarchy), the frontend will also be possible to test thanks to QUnit in a future update (besides the "text" editor side which still requires a refactoring to be able to do that). --- Here are some of the changes: (-) conventions and documentation The code has been updated to follow JS conventions and a lot of code has been commented (around +2000 lines of comment). This also means that lots of functions have been renamed to use camelCase or simply to make their name understandable. See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines. (-) deprecated: web_editor.base The "web_editor.base" module has been split and does not force the modules which require it to wait for DOM ready anymore. This was indeed slowing loading times, but also prevented to use some modules in some contexts (see the LESS editor use in web_studio which is the subject of another task). Now the "editor context" can be got thanks to the "web_editor.context" JS module with its "get" function. The "web_editor.base" module should probably not be used anymore (see its code and recent updates). (-) new: web.dom_ready If a JS module should wait for the DOM to be ready to be executed, a new JS module has been created: "web.dom_ready". This should always be used in a module which only want to instantiate stuff. Do not extend (or worst, include) classes after DOM ready. (-) website.website The "website.website" module has been split. "website.website" does not return anything useful anymore, it just initialize some miscellaneous stuff, without waiting for the DOM to be ready. You might want to check "website.utils", "website.content.compatibility" or `WebsiteRoot`. Also `website.form` has been deleted (use `this._rpc`), so has been `website.error`. `website.prompt` will be removed in a future update to be replaced by `Dialog.prompt`. (-) widgets are great Many classes which were not widgets are now widgets. This allows them to use the 'events', the 'xmlDependencies' and the 'this._rpc' features for example. Here are some of the main ones: - Snippet options: these were classes with a `$el` for the menu element and `$target` for the customized element. This is still the case but following standard `Widget` structure (one exception: using `this.$(...)` searches in the `$target` as before this update). - Snippet animations: instead of class instances with a `$target` element which can be `start` and `stop`, these are now standard widgets which can be `start` and `destroy`. `this.$target` is an alias to `this.$el` for ease of compatibility. - Snippet editors: instead of class instances in charge of an editor overlay, these are now widgets. Each "child" snippet editor is properly attached as a "child", which allows editors to communicate and to be properly destroyed. (-) root widgets and website navbar The frontend is different of the backend. In the backend, the page has an empty <body/> element and all the components are instantiated from parent to children (i.e. the `WebClient` is instantiated and is in charge of instantiating the `ControlPanel`, etc). The frontend cannot work like that on page loadings as they are way more frequent than in the backend and we do not want them to flicker. A frontend page is loaded as a <body/> element which already contains the website navbar and its menus and the whole content page. JS code has to be "attached" to these existing elements. This is possible thanks to the `RootWidget` instances and the specialized `WebsiteRoot`, `IframeRoot` and `WebsiteNavbar` (see code for details). (-) lazy loading No more (or at least a lot less) XML/JS has to be loaded on page loading, thanks to the use of the `Widget.xmlDependencies` feature. XML which have to be lazy loaded is loaded only on related Widget instantiation if necessary, which allows to execute a lot of JS code before the DOM is ready and to start many widgets on DOM ready (not later). A visual benefit of this is clicking on the 'edit' button as soon as it is possible: before this commit, this was sometimes not doing anything as event handlers were not binded yet. Still a possible exception: loading the session and locales. This may be asynchronous stuff which is still required before widget instantiations but this will be the subject of another task. (-) deprecated code and code location More than reviewing code and organizing it, many apparent dead code was removed. More importantly, mislocated code was put in the right app. This is the case for snippet animations which is a concept for website apps but was defined in the web_editor app, or some translation concepts which were part of website but should have been part of web_editor. --- There are probably more things to say about this commit but I will let the comments speak for those.
2017-07-26[MERGE] forward port branch saas-15 up to 681f03e3097Christophe Simonis
2017-07-26[FIX] website_links: missing translationsNicolas Martinelli
opw-756108
2017-04-11[REF] web, *: simplify our RPC system (in JS)Géry Debongnie
The RPC system was not completely satisfactory, we decided to prepare the future and do it properly. This commit introduces the new rpc system, which replace the previous new one. We now simply have a method, this._rpc, which takes a dictionary of parameters. The idea is that depending on the parameters, it is able to add correct default value when necessary. For situations where we don't have the this._rpc method, we can use the rpc.query method, which takes the same arguments, but directly calls ajax.rpc instead of triggering up some events.
2017-04-11[REF] *: use _rpc method for all rpcsGéry Debongnie
The _rpc method is now the preferred method to do a rpc, so we need to update all calls.
2017-04-11[REF] web,*: remove 'web.model' and 'web.dataModelGéry Debongnie
Use this.rpc instead of Model object, with web.ajax if necessary. nb: EventDispatcherMixin include now the custom_events managment instead of widget
2016-12-30[MERGE] foward port of 10.0 up to revision ↵qdp-odoo
84a650e33aadb29661121410813e3de37a5ad3e9
2016-12-14[MERGE] forward port branch 9.0 up to a9a7fe15b34Christophe Simonis
2016-12-09[FIX] website_links: adapt countries pie chart heightDenis Ledoux
With a high number of countries, the pie chart was partially hidden. We adapt the svh height according to the number of country to display. opw-691941
2016-05-13[FIX] website_link: fix zeroClipboard configJeremy Kersten
ZeroClipboard lib has been moved from web to website_link but config file has been not updated.
2016-01-19[FIX] website_links: don't show the label on the pie chartChristophe Matthieu
The label is already display just before the pie and the label are display one over the other preventing visibility. opw-666405
2016-01-19[FIX] website_links: update the chart when user change tab or resizeChristophe Matthieu
Issue: On the front-end try to see the statistics and change tab, the graph is very messy. (The chart width equal 5px when the bootstrap tab is closed) Use trigger resize to update graph but use trigger is an error, must call all update directly. opw-666405
2015-11-19[FIX] website_links: we dont want no crash in nvd3Géry Debongnie
nvd3 was updated recently, and its api has slightly changed. The call to nvd3 was no longer correct.
2015-10-29[FIX] web,account,website_links: update nvd3 to last versionGéry Debongnie
This commit was necessary to fix weird problems in 9.0-nightly. Phantomjs and the old nvd3 implementations did not play well together. * transitionDuration() replaced by duration() * tooltips() & tooltipContent replaced by tooltip.enable and tooltip.contentGenerator * remove useless less for tooltip Thanks to mge for his help
2015-07-22[MERGE] forward port of branch saas-6 up to 63e92cbChristophe Simonis
2015-07-22[IMP] web: module can be asynchronous loaded if it return a deferredChristophe Matthieu
Each module can return a deferred. In that case, the module is marked as loaded only when the deferred is resolved, and its value is equal to the resolved value. The module can be rejected (unloaded). This will be logged in the console as info. Remove if_dom_contains from the website, the modules return a rejected deferred if the DOM doesn't contains the seleted values.
2015-07-10[IMP] mass_mailing: remove depends to website. Create a website_mass_mailing ↵Christophe Matthieu
bridge to add subscribe snippet into website builder. Split website_links to have link_tracker to create short and trackable URLs, and website_links to have a website layout for link_tracker and add button to share page.
2015-07-10[IMP] web_editor: adapt css, js and xml to use web_editorChristophe Matthieu
2015-07-08[FIX] website_links: don't allow an empty link codeNicolas Lempereur
An empty code would get a link with an existing controller (/r/). closes #7499 opw-644156
2015-05-05[IMP] accounting v9. Yeeeeaahqdp-odoo
2015-04-24[IMP] New design : menus reorganizationYannick Tivisse
- Several Modules have been splitted into several apps Examples : Human Resources : Splitted into Leaves, Recruitment, Expenses, Appraisals, Timesheets, Employees, Payroll Marketing : Mass Mailing, Events, ... Messaging : Chat, Agenda, Notes, Address Book, ... - Generally, the related reports have been moved in the apps, as last menu - Also, configuration menu (no_one group) have been moved into a config root menu exception made for the warehouse and lunch modules - Configuration for typical frontend modules have been moved into the website settings Related modules : Ecommerce, blog, slides, forum - When they are present, menus like 'product' or 'customers' have been moved ex : Customers in Sales menu, Product in POS menu - A lot of sequences and xmlids have been added or modified in this commit - List of apps : 1 Chat : Inbox, Channels 2 Agenda : Calendar 3 Notes 4 Address Book : The view contact is still laying in the mail module (1 app => 2 icons) 5 eCommerce : Still to define : Config + Orders Analysis + Shipping + incoming Amazon module 6 Sales : Dashboard (Sales Team Kanban), CRM, Sales (note that they are splitted into 2 submenus) Assignation, After-Sales (Invoicing and Services), Reports 7 Point of Sale : Dashboard (POS status), Orders, Reports 8 Project : Dashboard (Project Kanban), Search (all tasks, issues), Incoming Forecasts module, Reports Project.issue.version feature has been removed completely 9 Members : Dashboard (Members Kanban), Report, Config 10 Timesheets : Time Tracking, Approvals, Reports 11 Purchase : Purchase, Control (Products and Bills) 12 Warehouse : Dashboard (Warehouse Kanban), Operations, Inventory Control, Schedulers, Configuration 13 Manufacturing : Same menu structure 14 Mass Mailing : Mailings, Campaigns, Reports 15 Events : Events, Reports 16 Lead Automation : Campaigns, Reports 17 Surveys : Surveys, Reports 18 Human Resources : Dashboard (Departments Kanban), Employees, Contracts, Engagement (Gamification) 19 Recruitment : Job Positions, Applications, Resumes & Letters, Reports 20 Expenses : Expenses, Approvals, Reports 21 Leaves : My Leaves, Approvals, Reports 22 Appraisals : Appraisals, Interview, Reports --> Will probably be modified by the incoming refactoring 23 Payroll : Current Menu 24 Lunch : My Lunch, Manager, Configuration 25 Accounting : Same menus currently, waiting the new accounting to be merged 26 Fleet : Current menu 27 Sign : Incoming docusign module 28 No root menuitem with this sequence 29 Attendance : Attendance, Reports Sign in/out by project feature has been removed completely 30 Link Tracker (group_no_one) : Link Tracker, UTMs New view added : URL Shortner, which is the frontend view embedded in backend 31 Versionning : Website domain, Versions, Experiments 32 Slides (group_no_one) : Channels, Categories, Slides, Tags 33 No root menu item with this sequence 34 Livechat : Channels, History, Reports 35 Dashboards : My Boards, Configuration 36 App Store : Local Modules, Apps, Updates Last Settings : Incoming Dashboard Settings, Sales, ...., Website Settings General Pattern for all modules' settings : | Module_name |-- Settings : General Config view (checkbox screen) |-- Record setting 1 |-- ... |-- Record setting n Example for Sale module | Sales |-- Settings : Checkbox screen |-- Quotations |---- Quotation Templates |---- Report Layout Categories |---- Contract Template |---- Invoice Type |-- Contract |---- Deduplicate Contacts |-- Delivery |---- Delivery Methods |---- Delivery Pricelist
2015-04-10[FIX] Website links with new APIJulien De Coster
2015-03-18[IMP] web+addons: improvement to module systemGéry Debongnie
The module system needs to know the dependencies of a given module before executing the function. This is why the dependencies were defined once in an array, and then were described one more times in the call to require. But a trick can simplify this: the boot function can parse the string representation of the module and extract the calls to require from it. It is more work for the processor, but it leads to simpler module definitions.
2015-03-18[REF] website_links: update to the new module systemGéry Debongnie