diff --git a/client/src/app/site/pages/meetings/view-models/view-meeting.ts b/client/src/app/site/pages/meetings/view-models/view-meeting.ts index e41336ec34..4a0c212dfc 100644 --- a/client/src/app/site/pages/meetings/view-models/view-meeting.ts +++ b/client/src/app/site/pages/meetings/view-models/view-meeting.ts @@ -41,6 +41,7 @@ import { ViewProjection, ViewProjector, ViewProjectorCountdown, ViewProjectorMes import { ViewUser } from './view-user'; export const MEETING_LIST_SUBSCRIPTION = `meeting_list`; +export const MEETING_CREATE_SUBSCRIPTION = `meeting_create`; export enum RelatedTime { Future = 1, diff --git a/client/src/app/site/pages/organization/organization.subscription.ts b/client/src/app/site/pages/organization/organization.subscription.ts index e05c3cdc9e..0bd7fa636e 100644 --- a/client/src/app/site/pages/organization/organization.subscription.ts +++ b/client/src/app/site/pages/organization/organization.subscription.ts @@ -1,6 +1,9 @@ import { FULL_FIELDSET } from 'src/app/domain/fieldsets/misc'; import { SubscriptionConfigGenerator } from 'src/app/domain/interfaces/subscription-config'; -import { MEETING_LIST_SUBSCRIPTION } from 'src/app/site/pages/meetings/view-models/view-meeting'; +import { + MEETING_CREATE_SUBSCRIPTION, + MEETING_LIST_SUBSCRIPTION +} from 'src/app/site/pages/meetings/view-models/view-meeting'; import { ORGANIZATION_ID } from 'src/app/site/pages/organization/services/organization.service'; import { ViewOrganization } from 'src/app/site/pages/organization/view-models/view-organization'; @@ -36,6 +39,19 @@ export const getOrganizationSubscriptionConfig: SubscriptionConfigGenerator = () isDelayed: false }); +export const getMeetingCreateSubscriptionConfig: SubscriptionConfigGenerator = () => ({ + modelRequest: { + viewModelCtor: ViewOrganization, + ids: [ORGANIZATION_ID], + follow: [ + getMeetingCreateFollowConfig(`active_meeting_ids`), + getMeetingCreateFollowConfig(`archived_meeting_ids`), + getMeetingCreateFollowConfig(`template_meeting_ids`) + ] + }, + subscriptionName: MEETING_CREATE_SUBSCRIPTION +}); + function getMeetingListFollowConfig( idField: `active_meeting_ids` | `archived_meeting_ids` | `template_meeting_ids` ): any { @@ -48,3 +64,13 @@ function getMeetingListFollowConfig( fieldset: `list` }; } + +function getMeetingCreateFollowConfig( + idField: `active_meeting_ids` | `archived_meeting_ids` | `template_meeting_ids` +): any { + return { + idField: idField, + follow: [{ idField: `committee_id`, fieldset: `name` }], + fieldset: [`name`] + }; +} diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/committee-detail-meeting-main/committee-detail-meeting-main.component.ts b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/committee-detail-meeting-main/committee-detail-meeting-main.component.ts index 162b8bb7f3..c457071ee0 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/committee-detail-meeting-main/committee-detail-meeting-main.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/committee-detail-meeting-main/committee-detail-meeting-main.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { Id } from 'src/app/domain/definitions/key-types'; import { BaseModelRequestHandlerComponent } from 'src/app/site/base/base-model-request-handler.component'; +import { getMeetingCreateSubscriptionConfig } from 'src/app/site/pages/organization/organization.subscription'; import { getCommitteeMeetingDetailSubscriptionConfig } from '../../../../../../committees.subscription'; @@ -15,4 +16,8 @@ export class CommitteeDetailMeetingMainComponent extends BaseModelRequestHandler this.subscribeTo(getCommitteeMeetingDetailSubscriptionConfig(id), { hideWhenDestroyed: true }); } } + + protected override onShouldCreateModelRequests(): void { + this.subscribeTo(getMeetingCreateSubscriptionConfig()); + } }