Merge pull request #4314 from FinnStutzenstein/implementMissingUpdateInViewUser
Implement missing update behaviour for users
This commit is contained in:
commit
96a63ecd77
@ -125,6 +125,7 @@ export class ViewItem extends BaseViewModel {
|
|||||||
|
|
||||||
public updateDependencies(update: BaseViewModel): boolean {
|
public updateDependencies(update: BaseViewModel): boolean {
|
||||||
if (
|
if (
|
||||||
|
update &&
|
||||||
update.collectionString === this.item.content_object.collection &&
|
update.collectionString === this.item.content_object.collection &&
|
||||||
update.id === this.item.content_object.id
|
update.id === this.item.content_object.id
|
||||||
) {
|
) {
|
||||||
|
@ -206,21 +206,13 @@ export class ViewUser extends BaseProjectableViewModel implements Searchable {
|
|||||||
return this.full_name;
|
return this.full_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Implement
|
|
||||||
*/
|
|
||||||
public replaceGroup(newGroup: ViewGroup): void {}
|
|
||||||
|
|
||||||
public updateDependencies(update: BaseViewModel): void {
|
public updateDependencies(update: BaseViewModel): void {
|
||||||
if (update instanceof ViewGroup) {
|
if (update instanceof ViewGroup && this.user.groups_id.includes(update.id)) {
|
||||||
this.updateGroup(update);
|
const groupIndex = this.groups.findIndex(group => group.id === update.id);
|
||||||
}
|
if (groupIndex < 0) {
|
||||||
}
|
this.groups.push(update);
|
||||||
|
} else {
|
||||||
public updateGroup(group: ViewGroup): void {
|
this.groups[groupIndex] = update;
|
||||||
if (this.user && this.user.groups_id) {
|
|
||||||
if (this.user.containsGroupId(group.id)) {
|
|
||||||
this.replaceGroup(group);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user