summaryrefslogtreecommitdiff
path: root/addons/website_links/static
AgeCommit message (Collapse)Author
2020-11-27[FIX] website_links: not perform a request during automated testBenoit Socias
This commit fixes the step trigger: '#o_website_links_link_tracker_form #generated_tracked_link:contains("/r/")' that was taking too long because of a call to _get_title_from_url happening during the creation of a 'link.tracker'. Before this commit the automated tests of website_links did trigger an http request on the 'contactus' page which sometimes took too long to respond and reached the test failure timeout. After this commit the information obtained from this request is hard-coded to avoid the unpredictable timing of the test. This commit is a manual port of #62479. task-2397724 closes odoo/odoo#62508 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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-05-01[REM] website,*: remove About us page and referencesDramixDw
Remove the default about us page because it could be easily recreated and doesn't add a lot of value to the website. task-2189613
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-12-09[REV] web: reverts update to fontawesome 5.11.2Kevin Baptiste
This reverts commit ff1c35513aecef5fbc30f7c2f3834450e719714e. closes odoo/odoo#41480 X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc Related: odoo/enterprise#7110 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28[IMP] web: update to fontawesome 4.7.0 to 5.11.2Kevin Baptiste
FontAwesome 5 introduced new names for some icons as described on https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes This commit replaces the old names to the new ones. closes odoo/odoo#35826 Taskid: 2050241 Related: odoo/enterprise#5180 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-10-10[REM] website_links: remove favicon, icon_src for performanceryv-odoo
The link tracker model (link.tracker) contained favicon (store) and icon_src computed fields. Computing favicon took {3-6.5%} of installing odoo (with demo data) due to syncronous http call to a external link (google). Moreover, these fields had no sense to be store in odoo and only used in one template. This template was modified to display the same information (icon) as before but without storing fields and with a lazy loading of icons. TASK_ID: 2083715 closes odoo/odoo#38405 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.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-17[FIX] website_links: restore filter buttons (useless breaking rules)qsm-odoo
Revealed with BS4.
2018-08-09[REF] *: improve app icons, add SVG versionstefanorigano
- Uniform colors and design - Replace duplicated icons (eg. sale / sale_management) - Improve misleading icons (eg. POS) - Add icons for new apps Add SVG versions to lossless future editing and print/marketing use. task-54681
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-07-27[REF] *: BS4, replace 'btn-xs' by 'btn-sm'qsm-odoo
In a previous commit, we removed the use of the 'btn-sm' classes as we used it everywhere for default-size buttons instead of customizing the size of those default-size buttons directly. This commit proves it was even more necessary as the 'btn-xs' class does not exist anymore in BS4 and we so can use the 'btn-sm' class instead.
2018-07-27[REF] *: BS4, adapt the label component structureqsm-odoo
The '.label' elements have been replaced by '.badge' elements without the 'badge-pill' class.
2018-07-27[REF] *: BS4, adapt col-related classesqsm-odoo
col-lg-* -> col-xl-* col-md-* -> col-lg-* col-sm-* -> col-md-* col-xs-* -> col-* col-lg-offset-* -> offset-xl-* col-md-offset-* -> offset-lg-* col-sm-offset-* -> offset-md-* col-xs-offset-* -> offset-* col-lg-pull-* -> order-xl-1 col-md-pull-* -> order-lg-1 col-sm-pull-* -> order-md-1 col-xs-pull-* -> order-1 col-lg-push-* -> order-xl-2 col-md-push-* -> order-lg-2 col-sm-push-* -> order-md-2 col-xs-push-* -> order-2
2018-06-22[IMP] Improve compatibility with screen readers (accessibility) (#24574)kujiu
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable. This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader. * [IMP] Labels must have a for attribute. Improve accessibility. * [IMP] Better error message when trying to read a missing cached value * [FIX] Add some aria-label and title attributes for screen readers. * [FIX] Template name is not included in the error message in case of SyntaxError in QWeb * [FIX] Improve the Tour failed at step error message to be more explicit. * [IMP] Add aria-labels * [FIX] Add missing aria-label on failing test * [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all. * [IMP] Color names on kanban views and many2many tags * [IMP] Add some checks on views for accessibility. * [IMP] Add `alt` attribute on `img` tags. * [IMP] Add aria-label and title on non-described icons * [IMP] Add button role to widgets with btn class * [IMP] Translate aria and formatted attributes. * [IMP] Remove wrong aria-labelledby * [IMP] Add menu role on dropdowns * [IMP] Buttons must be focusable * [IMP] Add aria attributes on progress bars * [IMP] Improve accessibility of basic widgets * [IMP] Change main layout to more semantic tags * [IMP] Add menuitem role when missing * [IMP] Remove wrong role='presentation' * [IMP] Improve accessibility of tab panels * [IMP] Add aria-invalid on invalid fields * [IMP] Add aria-sort on ordered columns * [IMP] Add role on alerts * [IMP] Use dialog role, header, main and footer tags for modals * [IMP] Add labels on o_status * [IMP] Improve accessibility of kanban view with feeds and articles * [IMP] Add alerts in case of new messages * [IMP] Add widget, navigation or img role to aria-labelled items
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-02-17[IMP] web: move ZeroClipboard lib into website_links addonChristophe Matthieu
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