mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-16 19:41:45 +02:00
- Send push messages for account delete
- Send actual push type for contact changes - Handle push deletes for admin
This commit is contained in:
@ -17,7 +17,7 @@ import 'jqueryui';
|
||||
import '../jsapi/egw_global';
|
||||
import '../etemplate/et2_types';
|
||||
|
||||
import {EgwApp} from '../../api/js/jsapi/egw_app';
|
||||
import {EgwApp, PushData} from '../../api/js/jsapi/egw_app';
|
||||
|
||||
/**
|
||||
* UI for Admin
|
||||
@ -315,6 +315,39 @@ class AdminApp extends EgwApp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a push notification about entry changes from the websocket
|
||||
*
|
||||
* Get's called for data of all apps, but should only handle data of apps it displays,
|
||||
* which is by default only it's own, but can be for multiple apps eg. for calendar.
|
||||
*
|
||||
* @param pushData
|
||||
* @param {string} pushData.app application name
|
||||
* @param {(string|number)} pushData.id id of entry to refresh or null
|
||||
* @param {string} pushData.type either 'update', 'edit', 'delete', 'add' or null
|
||||
* - update: request just modified data from given rows. Sorting is not considered,
|
||||
* so if the sort field is changed, the row will not be moved.
|
||||
* - edit: rows changed, but sorting may be affected. Requires full reload.
|
||||
* - delete: just delete the given rows clientside (no server interaction neccessary)
|
||||
* - add: requires full reload for proper sorting
|
||||
* @param {object|null} pushData.acl Extra data for determining relevance. eg: owner or responsible to decide if update is necessary
|
||||
* @param {number} pushData.account_id User that caused the notification
|
||||
*/
|
||||
push(pushData : PushData)
|
||||
{
|
||||
// We'll listen to addressbook, but only if it has an account ID
|
||||
if (pushData.app != this.appname) return;
|
||||
|
||||
if(pushData.id > 0)
|
||||
{
|
||||
this.nm.refresh(pushData.id, pushData.type);
|
||||
}
|
||||
else if (pushData.id < 0)
|
||||
{
|
||||
this.groups.refresh(pushData.id, pushData.type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide navbar for idots template
|
||||
*
|
||||
|
Reference in New Issue
Block a user