MOBILE-3523 core: Fix handlers order if one hasn't priority

main
Dani Palou 2020-10-05 11:42:21 +02:00
parent 8d95636690
commit 94b215816e
12 changed files with 12 additions and 11 deletions

View File

@ -191,7 +191,7 @@ export class CoreContentLinksDelegate {
// Add them to the list.
linkActions.push({
priority: handler.priority,
priority: handler.priority || 0,
actions: actions
});
}

View File

@ -405,7 +405,7 @@ export class CoreCourseOptionsDelegate extends CoreDelegate {
promises.push(Promise.resolve(getFunction.call(handler, injector, course)).then((data) => {
handlersToDisplay.push({
data: data,
priority: handler.priority,
priority: handler.priority || 0,
prefetch: handler.prefetch && handler.prefetch.bind(handler),
name: handler.name
});

View File

@ -177,7 +177,7 @@ export class CoreFileUploaderDelegate extends CoreDelegate {
}
const data: CoreFileUploaderHandlerDataToReturn = handler.getData();
data.priority = handler.priority;
data.priority = handler.priority || 0;
data.mimetypes = supportedMimetypes;
handlers.push(data);
}

View File

@ -162,7 +162,7 @@ export class CoreMainMenuDelegate extends CoreDelegate {
handlersData.push({
name: name,
data: data,
priority: handler.priority
priority: handler.priority || 0,
});
}

View File

@ -177,6 +177,7 @@ export class CorePushNotificationsDelegate {
this.logger.log(`Registered addon '${handler.name}'`);
this.clickHandlers[handler.name] = handler;
handler.priority = handler.priority || 0;
return true;
}

View File

@ -108,7 +108,7 @@ export class CoreSettingsDelegate extends CoreDelegate {
handlersData.push({
data: data,
priority: handler.priority
priority: handler.priority || 0,
});
}

View File

@ -35,7 +35,7 @@ export class CoreSitePluginsCourseOptionHandler extends CoreSitePluginsBaseHandl
protected utils: CoreUtilsProvider) {
super(name);
this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;
this.isMenuHandler = !!handlerSchema.ismenuhandler;
}

View File

@ -25,7 +25,7 @@ export class CoreSitePluginsMainMenuHandler extends CoreSitePluginsBaseHandler i
protected initResult: any) {
super(name);
this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;
}
/**

View File

@ -32,7 +32,7 @@ export class CoreSitePluginsMessageOutputHandler extends CoreSitePluginsBaseHand
*/
getDisplayData(): AddonMessageOutputHandlerData {
return {
priority: this.handlerSchema.priority,
priority: this.handlerSchema.priority || 0,
label: this.title,
icon: this.handlerSchema.displaydata.icon,
page: 'CoreSitePluginsPluginPage',

View File

@ -25,7 +25,7 @@ export class CoreSitePluginsSettingsHandler extends CoreSitePluginsBaseHandler i
protected initResult: any) {
super(name);
this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;
}
/**

View File

@ -43,7 +43,7 @@ export class CoreSitePluginsUserProfileHandler extends CoreSitePluginsBaseHandle
protected utils: CoreUtilsProvider) {
super(name);
this.priority = handlerSchema.priority;
this.priority = handlerSchema.priority || 0;
// Only support TYPE_COMMUNICATION and TYPE_NEW_PAGE.
this.type = handlerSchema.type != CoreUserDelegate.TYPE_COMMUNICATION ?

View File

@ -260,7 +260,7 @@ export class CoreUserDelegate extends CoreDelegate {
userData.handlers.push({
name: name,
data: handler.getDisplayData(user, courseId),
priority: handler.priority,
priority: handler.priority || 0,
type: handler.type || CoreUserDelegate.TYPE_NEW_PAGE
});
}