Skip to content
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] all: Font-Awesome v5 #48094

Open
wants to merge 4 commits into
base: master
from

Conversation

@Julien00859
Copy link
Member

Julien00859 commented Mar 20, 2020

Font-awesome v4 have been supplanted by a v5 in September 2017, it is about time we migrate our source code to support that new version.

The two version major difference is about icon identification. In FA v4 the icon name only is enough, every icon name had its own character like 'fa-clock' is the only solid clock font, 'fa-clock-o' is the only edge clock font. In FA v5, every icons can come with up to 5 (in the pro version) different styles for a same icon name. In FA v5, an icon identifier is the pair icon style and icon name.

Commit n°1 contains the different source assets of FA v5.
Commit n°2 updates all the source code that use the assets, stylesheets in html head and web_editor mostly.
Commit n°3 is the result of an automatic (https://xkcd.com/208/) translation from v4 to v5 in every view.
Commit n°4 is the result of an handmade translation from v4 to v5 for the leftover icons the script of n°3 couldn't find, mostly imperative JS code that was programmatically adding and removing icons.

Task: 2050241

@Julien00859 Julien00859 requested a review from Gorash Mar 20, 2020
@robodoo robodoo added the seen 🙂 label Mar 20, 2020
@C3POdoo C3POdoo added the RD label Mar 20, 2020
@Julien00859 Julien00859 force-pushed the odoo-dev:master-2050241-fontawesome-v5-juc branch 3 times, most recently from 48ee40d to 179226a Mar 20, 2020
@@ -190,25 +190,27 @@ function getMatchedCSSRules(a) {
function fontToImg($editable) {
var fonts = odoo.__DEBUG__.services["wysiwyg.fonts"];

$editable.find('.fa').each(function () {
$editable.find('.fa, .far, .fas, .fab').each(function () {

This comment has been minimized.

Copy link
@Gorash

Gorash Mar 23, 2020

Contributor

@Zinston to see for new editor

@Gorash
Gorash approved these changes Mar 23, 2020
Copy link
Contributor

Gorash left a comment

Good for me

*
* @type Array
*/
fontIcons: [{base: 'fa', parser: /\.(fa-(?:\w|-)+)::?before/i}],

This comment has been minimized.

Copy link
@Gorash

Gorash Mar 23, 2020

Contributor

So now we don't use any other icons than font-awsome. (which is quite good considering the themes of odoo)

@Julien00859 Julien00859 force-pushed the odoo-dev:master-2050241-fontawesome-v5-juc branch from 179226a to 9df75c3 Mar 24, 2020
@Julien00859 Julien00859 changed the title [WIP] Font-Awesome v5 [IMP] all: Font-Awesome v5 Mar 24, 2020
@Julien00859 Julien00859 force-pushed the odoo-dev:master-2050241-fontawesome-v5-juc branch 9 times, most recently from 13881f8 to e9d2a49 Mar 24, 2020
@Julien00859

This comment has been minimized.

Copy link
Member Author

Julien00859 commented Mar 25, 2020

I love iframes, they are a very neat piece of technology, I wonder why we don't use them more often.

Day 2 debugging website_slides craps.

@Julien00859 Julien00859 force-pushed the odoo-dev:master-2050241-fontawesome-v5-juc branch from e9d2a49 to acdef66 Mar 25, 2020
@Julien00859 Julien00859 force-pushed the odoo-dev:master-2050241-fontawesome-v5-juc branch 2 times, most recently from 9b7113f to 0e4f62b Apr 9, 2020
@robodoo robodoo added the CI 🤖 label Apr 9, 2020
@Julien00859 Julien00859 force-pushed the odoo-dev:master-2050241-fontawesome-v5-juc branch from 0e4f62b to 750e15f Apr 9, 2020
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Apr 9, 2020
Julien00859 added 3 commits Mar 23, 2020
Font-awesome v4 have been supplanted by a v5 in September 2017, it is
about time we migrate our source code to support that new version.

The two version major difference is about icon identification. In FA v4
the icon name only is enough, every icon name had its own character like
'fa-clock' is the only solid clock font, 'fa-clock-o' is the only edge
clock font. In FA v5, every icons can come with up to 5 (in the pro
version) different styles for a same icon name. In FA v5, an icon
identifier is the pair icon style and icon name.

This commit updates all the source code that use the assets, stylesheets
in html head and web_editor mostly.

Task: 2050241
Font-awesome v4 have been supplanted by a v5 in September 2017, it is
about time we migrate our source code to support that new version.

The two version major difference is about icon identification. In FA v4
the icon name only is enough, every icon name had its own character like
'fa-clock' is the only solid clock font, 'fa-clock-o' is the only edge
clock font. In FA v5, every icons can come with up to 5 (in the pro
version) different styles for a same icon name. In FA v5, an icon
identifier is the pair icon style and icon name.

This commit contains the different source assets of FA v5.

Task: 2050241
Font-awesome v4 have been supplanted by a v5 in September 2017, it is
about time we migrate our source code to support that new version.

The two version major difference is about icon identification. In FA v4
the icon name only is enough, every icon name had its own character like
'fa-clock' is the only solid clock font, 'fa-clock-o' is the only edge
clock font. In FA v5, every icons can come with up to 5 (in the pro
version) different styles for a same icon name. In FA v5, an icon
identifier is the pair icon style and icon name.

This commit updates piece of codes that was using v4 icons using an
automatic search/match/replace script similar to the one used in
the migrations to update customer websites.

Task: 2050241
Font-awesome v4 have been supplanted by a v5 in September 2017, it is
about time we migrate our source code to support that new version.

The two version major difference is about icon identification. In FA v4
the icon name only is enough, every icon name had its own character like
'fa-clock' is the only solid clock font, 'fa-clock-o' is the only edge
clock font. In FA v5, every icons can come with up to 5 (in the pro
version) different styles for a same icon name. In FA v5, an icon
identifier is the pair icon style and icon name.

Not all icons could be automatically migrated, this commit manually
upgrades leftover icons.

Task: 2050241
@Julien00859 Julien00859 force-pushed the odoo-dev:master-2050241-fontawesome-v5-juc branch from 750e15f to ca6b6cb Apr 10, 2020
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.