-
Notifications
You must be signed in to change notification settings - Fork 98
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
perf: lazy load otrs section #4340
Conversation
angular.module(moduleName, ['oc.lazyLoad', 'ui.router']).config( | ||
/* @ngInject */ ($stateProvider, $urlRouterProvider, coreConfigProvider) => { | ||
const region = coreConfigProvider.getRegion(); | ||
if (region === 'US') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lazy load the module for US region otherwise perform a redirection
self.init = function init() { | ||
// self.createMenu(); | ||
self.isLoaded = true; | ||
$compile(angular.element('#otrs-popup'))($rootScope.$new()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added this line :
the otrs-popup directive code will only be loaded for US region, so we need to compile the directive (https://github.com/ovh/manager/pull/4340/files#diff-4eaf543ac34656361a5e0375c3730f87305031a7a866a005d4ce09d01183723dR134) after the otrs module have been lazy loaded
98197d5
to
b29a0f2
Compare
@@ -291,7 +291,7 @@ <h1 data-translate="otrs_title"></h1> | |||
</tbody> | |||
<tbody data-ng-show="!loaders.tickets && tickets.ids.length"> | |||
<tr | |||
data-ng-repeat="ticket in tickets.detail | orderBy:'creationDate':true track by ticket.ticketNumber" | |||
data-ng-repeat="ticket in tickets.detail | orderBy:'creationDate':true track by ticket.ticketNumber+$index" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a fix here because there is a silent error in production (duplicate index in repeater)
The base branch was changed.
b29a0f2
to
e400fe5
Compare
return '/support'; | ||
} | ||
if (/^\/ticket\//.test(path)) { | ||
return path.replace(/^\/ticket\//, '/support/tickets/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in a (near) future we could uniformize urls as it is quite confusing to know when it is supposed to be /ticket
or /support/tickets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i suppose it was introduced for backward compatibility with old urls, i wonder if it's still necessary
e400fe5
to
f66634b
Compare
90613ee
to
a5cc6f1
Compare
Signed-off-by: frenauvh <[email protected]>
a5cc6f1
to
24ce039
Compare
develop
Description
Lazy load otrs section (part is conditionnally loaded only for US region)