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

Remove ng-include in notifications #4813

Merged
merged 4 commits into from
Oct 24, 2018
Merged

Remove ng-include in notifications #4813

merged 4 commits into from
Oct 24, 2018

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Oct 23, 2018

In #4793 we started removing templates loaded asynchronously from other templates via ng-include.

Continuing with that - removing all remaining ng-include statements..

titleInclude was unused, removed
headingInclude was used for a 2 line partial, inlined
subheadingInclude the same
notificationBodyInclude replaced with render :partial so that we only have to do 1 request instead of 2
(notificationFooterInclude inlined in #4793)


The result of the 2 PRs is that we're now doing only 2 notifications-related requests on load (api, and template), instead of 6.

https://bugzilla.redhat.com/show_bug.cgi?id=1571223

… of ng-include

large template, so not inlining, but at least we can drop the extra async request for it

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1571223
@himdel
Copy link
Contributor Author

himdel commented Oct 23, 2018

Cc @skateman

@miq-bot
Copy link
Member

miq-bot commented Oct 23, 2018

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/94259d4dae5b047d5b55e57a865f9921e4a36a74~...97d83f2997d27951582d64c7da14e1bfc3ad9e6b with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
6 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

'ng-repeat' => "notification in notificationGroup.notifications | limitTo:limit.notifications:(notificationGroup.notifications.length - limit.notifications)",
'ng-include' => "notificationBodyInclude"}
'ng-repeat' => "notification in notificationGroup.notifications | limitTo:limit.notifications:(notificationGroup.notifications.length - limit.notifications)"}
= render :partial => 'static/notification_drawer/notification-body'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this needs to be in a partial?

Copy link
Contributor Author

@himdel himdel Oct 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason at all, just didn't want to make the file unreadably large.
Should I just inline it too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, you don't have to!

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Seal of Approval

@mzazrivec mzazrivec self-assigned this Oct 24, 2018
@mzazrivec mzazrivec added this to the Sprint 98 Ending Nov 5, 2018 milestone Oct 24, 2018
@mzazrivec mzazrivec merged commit ec520f4 into ManageIQ:master Oct 24, 2018
@himdel himdel deleted the ng-include branch October 24, 2018 10:41
simaishi pushed a commit that referenced this pull request Oct 24, 2018
Remove ng-include in notifications

(cherry picked from commit ec520f4)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1571223
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 0cd47efe5127962aed5f24d838b1d107ddbfe82d
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Wed Oct 24 08:22:13 2018 +0200

    Merge pull request #4813 from himdel/ng-include
    
    Remove ng-include in notifications
    
    (cherry picked from commit ec520f4f81accba173aee2d045329b18ea20e591)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1571223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants