-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve meeting change subscription handling (#3604)
- Loading branch information
1 parent
f332307
commit 6325451
Showing
25 changed files
with
272 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
client/src/app/site/pages/meetings/base/base-meeting-model-request-handler.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Directive } from '@angular/core'; | ||
import { Id } from 'src/app/domain/definitions/key-types'; | ||
import { SubscriptionConfig } from 'src/app/domain/interfaces/subscription-config'; | ||
import { BaseModelRequestHandlerComponent } from 'src/app/site/base/base-model-request-handler.component'; | ||
|
||
@Directive() | ||
export abstract class BaseMeetingModelRequestHandler extends BaseModelRequestHandlerComponent { | ||
protected abstract getSubscriptions(meetingId: Id): SubscriptionConfig<any>[]; | ||
|
||
protected override onShouldCreateModelRequests(_params: any, id: number | null): void { | ||
if (id) { | ||
this.subscribeTo(this.getSubscriptions(id), { hideWhenMeetingChanged: true }); | ||
} | ||
} | ||
|
||
protected override onNextMeetingId(id: number | null): void { | ||
if (id) { | ||
this.updateSubscribeTo(this.getSubscriptions(id), { hideWhenMeetingChanged: true }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
.../pages/meetings/pages/assignments/components/assignment-main/assignment-main.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { Component } from '@angular/core'; | ||
import { BaseModelRequestHandlerComponent } from 'src/app/site/base/base-model-request-handler.component'; | ||
import { Id } from 'src/app/domain/definitions/key-types'; | ||
import { SubscriptionConfig } from 'src/app/domain/interfaces/subscription-config'; | ||
|
||
import { BaseMeetingModelRequestHandler } from '../../../../base/base-meeting-model-request-handler.component'; | ||
import { getAssignmentSubscriptionConfig } from '../../assignments.subscription'; | ||
|
||
@Component({ | ||
selector: `os-assignment-main`, | ||
templateUrl: `./assignment-main.component.html`, | ||
styleUrls: [`./assignment-main.component.scss`] | ||
}) | ||
export class AssignmentMainComponent extends BaseModelRequestHandlerComponent { | ||
protected override onNextMeetingId(id: number | null): void { | ||
if (id) { | ||
this.subscribeTo(getAssignmentSubscriptionConfig(id), { hideWhenMeetingChanged: true }); | ||
} | ||
export class AssignmentMainComponent extends BaseMeetingModelRequestHandler { | ||
protected getSubscriptions(id: Id): SubscriptionConfig<any>[] { | ||
return [getAssignmentSubscriptionConfig(id)]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...ite/pages/meetings/pages/mediafiles/components/mediafile-main/mediafile-main.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { Component } from '@angular/core'; | ||
import { BaseModelRequestHandlerComponent } from 'src/app/site/base/base-model-request-handler.component'; | ||
import { Id } from 'src/app/domain/definitions/key-types'; | ||
import { SubscriptionConfig } from 'src/app/domain/interfaces/subscription-config'; | ||
|
||
import { BaseMeetingModelRequestHandler } from '../../../../base/base-meeting-model-request-handler.component'; | ||
import { getMediafilesSubscriptionConfig } from '../../mediafiles.subscription'; | ||
|
||
@Component({ | ||
selector: `os-mediafile-main`, | ||
templateUrl: `./mediafile-main.component.html`, | ||
styleUrls: [`./mediafile-main.component.scss`] | ||
}) | ||
export class MediafileMainComponent extends BaseModelRequestHandlerComponent { | ||
protected override onNextMeetingId(id: number | null): void { | ||
if (id) { | ||
this.subscribeTo(getMediafilesSubscriptionConfig(id), { hideWhenMeetingChanged: true }); | ||
} | ||
export class MediafileMainComponent extends BaseMeetingModelRequestHandler { | ||
protected getSubscriptions(id: Id): SubscriptionConfig<any>[] { | ||
return [getMediafilesSubscriptionConfig(id)]; | ||
} | ||
} |
Oops, something went wrong.