From d881f22c414a9954668fb249e7e2772393dbf79e Mon Sep 17 00:00:00 2001 From: Elblinator Date: Wed, 30 Oct 2024 17:45:37 +0100 Subject: [PATCH 1/4] Add default field to subscriptions --- .../pages/agenda/agenda.subscription.ts | 8 +++---- .../assignments/assignments.subscription.ts | 3 +++ .../mediafiles/mediafiles.subscription.ts | 5 ++++- .../pages/motions/motions.subscription.ts | 11 ++++++---- .../participants/participants.subscription.ts | 9 +++++--- .../pages/polls/polls.subscription.ts | 5 +++-- .../projectors/projectors.subscription.ts | 21 ++++++++++++------- .../projectors/view-models/view-projector.ts | 6 +++--- .../services/active-meeting.subscription.ts | 8 ++++--- .../organization/organization.subscription.ts | 4 ++-- .../pages/accounts/accounts.subscription.ts | 4 ++-- .../committees/committees.subscription.ts | 3 ++- .../mediafiles/mediafiles.subscription.ts | 2 ++ .../organization-tags.subscription.ts | 3 ++- 14 files changed, 59 insertions(+), 33 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/agenda/agenda.subscription.ts b/client/src/app/site/pages/meetings/pages/agenda/agenda.subscription.ts index 9aa9056fbd..410441fb84 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/agenda.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/agenda.subscription.ts @@ -128,13 +128,13 @@ export const listOfSpeakersSpeakerCountSubscription = { follow: [ { idField: `speaker_ids`, + fieldset: [`begin_time`, `end_time`], follow: [ { idField: `point_of_order_category_id`, fieldset: FULL_FIELDSET } - ], - fieldset: [`begin_time`, `end_time`] + ] } ] }; @@ -151,11 +151,11 @@ export const getListOfSpeakersDetailSubscriptionConfig: SubscriptionConfigGenera follow: [ { idField: `meeting_user_id`, + fieldset: [`number`, `vote_weight`], follow: [ { idField: `user_id`, ...UserFieldsets.FullNameSubscription }, { idField: `structure_level_ids`, fieldset: [`name`] } - ], - fieldset: [`number`, `vote_weight`] + ] }, { idField: `structure_level_list_of_speakers_id`, diff --git a/client/src/app/site/pages/meetings/pages/assignments/assignments.subscription.ts b/client/src/app/site/pages/meetings/pages/assignments/assignments.subscription.ts index f65649c8e7..357b4e8b79 100644 --- a/client/src/app/site/pages/meetings/pages/assignments/assignments.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/assignments/assignments.subscription.ts @@ -3,6 +3,7 @@ import { FULL_FIELDSET } from 'src/app/domain/fieldsets/misc'; import { MeetingUserFieldsets } from 'src/app/domain/fieldsets/user'; import { SubscriptionConfigGenerator } from 'src/app/domain/interfaces/subscription-config'; import { ViewMeeting } from 'src/app/site/pages/meetings/view-models/view-meeting'; +import { DEFAULT_FIELDSET } from 'src/app/site/services/model-request-builder'; import { listOfSpeakersSpeakerCountSubscription } from '../agenda/agenda.subscription'; import { pollModelRequest } from '../polls/polls.subscription'; @@ -17,6 +18,7 @@ export const getAssignmentSubscriptionConfig: SubscriptionConfigGenerator = (id: follow: [ { idField: `assignment_ids`, + fieldset: DEFAULT_FIELDSET, follow: [ { idField: `attachment_meeting_mediafile_ids`, @@ -29,6 +31,7 @@ export const getAssignmentSubscriptionConfig: SubscriptionConfigGenerator = (id: }, { idField: `assignment_candidate_ids`, + fieldset: DEFAULT_FIELDSET, follow: [{ idField: `meeting_user_id`, ...MeetingUserFieldsets.FullNameSubscription }] } ] diff --git a/client/src/app/site/pages/meetings/pages/mediafiles/mediafiles.subscription.ts b/client/src/app/site/pages/meetings/pages/mediafiles/mediafiles.subscription.ts index 20573b4f5d..bb66c782bf 100644 --- a/client/src/app/site/pages/meetings/pages/mediafiles/mediafiles.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/mediafiles/mediafiles.subscription.ts @@ -43,7 +43,10 @@ export const getMediafilesListMinimalSubscriptionConfig: SubscriptionConfigGener modelRequest: { viewModelCtor: ViewMeeting, ids: [id], - follow: [`mediafile_ids`, `meeting_mediafile_ids`] + follow: [ + { idField: `mediafile_ids`, fieldset: DEFAULT_FIELDSET }, + { idField: `meeting_mediafile_ids`, fieldset: DEFAULT_FIELDSET } + ] }, subscriptionName: MEDIAFILES_LIST_MINIMAL_SUBSCRIPTION }); diff --git a/client/src/app/site/pages/meetings/pages/motions/motions.subscription.ts b/client/src/app/site/pages/meetings/pages/motions/motions.subscription.ts index 2bdbb50b76..6815faa0ae 100644 --- a/client/src/app/site/pages/meetings/pages/motions/motions.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/motions/motions.subscription.ts @@ -3,6 +3,7 @@ import { FULL_FIELDSET } from 'src/app/domain/fieldsets/misc'; import { MeetingUserFieldsets } from 'src/app/domain/fieldsets/user'; import { SubscriptionConfigGenerator } from 'src/app/domain/interfaces/subscription-config'; import { ViewMeeting } from 'src/app/site/pages/meetings/view-models/view-meeting'; +import { DEFAULT_FIELDSET } from 'src/app/site/services/model-request-builder'; import { listOfSpeakersSpeakerCountSubscription } from '../agenda/agenda.subscription'; import { pollModelRequest } from '../polls/polls.subscription'; @@ -121,10 +122,11 @@ export const getMotionWorkflowDetailSubscriptionConfig: SubscriptionConfigGenera viewModelCtor: ViewMotionWorkflow, follow: [ { - idField: `state_ids` + idField: `state_ids`, + fieldset: DEFAULT_FIELDSET } ], - fieldset: `` + fieldset: [] }, subscriptionName: MOTION_WORKFLOW_DETAIL_SUBSCRIPTION }); @@ -133,6 +135,7 @@ export const getMotionsSubmodelSubscriptionConfig: SubscriptionConfigGenerator = modelRequest: { viewModelCtor: ViewMeeting, ids: [id], + fieldset: DEFAULT_FIELDSET, follow: [ { idField: `motion_category_ids`, fieldset: FULL_FIELDSET }, { idField: `motion_state_ids`, fieldset: FULL_FIELDSET }, @@ -189,13 +192,13 @@ export const getMotionDetailSubscriptionConfig: SubscriptionConfigGenerator = (. { idField: `comment_ids`, fieldset: FULL_FIELDSET }, { idField: `supporter_meeting_user_ids`, + fieldset: `participantListMinimal`, follow: [ { idField: `user_id`, fieldset: `participantList` } - ], - fieldset: `participantListMinimal` + ] } ], fieldset: [ diff --git a/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts b/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts index 66709e2d1d..ff47bc764f 100644 --- a/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/participants/participants.subscription.ts @@ -37,8 +37,8 @@ export const getParticipantVoteInfoSubscriptionConfig: SubscriptionConfigGenerat }, { idField: `vote_delegated_to_id`, - follow: [{ idField: `user_id`, fieldset: [`is_present_in_meeting_ids`] }], - fieldset: [`meeting_id`] + fieldset: [`meeting_id`], + follow: [{ idField: `user_id`, fieldset: [`is_present_in_meeting_ids`] }] } ] } @@ -55,7 +55,10 @@ export const getParticipantIsPresentSubscriptionConfig: SubscriptionConfigGenera follow: [ { idField: `meeting_user_ids`, - follow: [{ idField: `user_id`, additionalFields: [`is_present_in_meeting_ids`] }] + fieldset: DEFAULT_FIELDSET, + follow: [ + { idField: `user_id`, fieldset: DEFAULT_FIELDSET, additionalFields: [`is_present_in_meeting_ids`] } + ] } ] }, diff --git a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts index eebfacdbdb..43a82e8e78 100644 --- a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts @@ -2,7 +2,7 @@ import { Id } from 'src/app/domain/definitions/key-types'; import { FULL_FIELDSET, MEETING_ROUTING_FIELDS } from 'src/app/domain/fieldsets/misc'; import { MeetingUserFieldsets, UserFieldsets } from 'src/app/domain/fieldsets/user'; import { SubscriptionConfigGenerator } from 'src/app/domain/interfaces/subscription-config'; -import { BaseSimplifiedModelRequest } from 'src/app/site/services/model-request-builder'; +import { BaseSimplifiedModelRequest, DEFAULT_FIELDSET } from 'src/app/site/services/model-request-builder'; import { ViewMeeting } from '../../view-models/view-meeting'; import { ViewPoll } from './view-models'; @@ -50,6 +50,7 @@ export const getPollListSubscriptionConfig: SubscriptionConfigGenerator = (id: I modelRequest: { viewModelCtor: ViewMeeting, ids: [id], + fieldset: DEFAULT_FIELDSET, follow: [{ idField: `poll_ids`, ...pollModelRequest }] }, subscriptionName: POLL_LIST_SUBSCRIPTION @@ -83,7 +84,7 @@ export const getPollDetailSubscriptionConfig: SubscriptionConfigGenerator = (... { idField: `global_option_id`, fieldset: FULL_FIELDSET, - follow: [{ idField: `vote_ids` }] + follow: [{ idField: `vote_ids`, fieldset: DEFAULT_FIELDSET }] } ] }, diff --git a/client/src/app/site/pages/meetings/pages/projectors/projectors.subscription.ts b/client/src/app/site/pages/meetings/pages/projectors/projectors.subscription.ts index b7a3917aed..a3cd007f8e 100644 --- a/client/src/app/site/pages/meetings/pages/projectors/projectors.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/projectors/projectors.subscription.ts @@ -24,9 +24,12 @@ export const getProjectorListSubscriptionConfig: SubscriptionConfigGenerator = ( modelRequest: { viewModelCtor: ViewMeeting, ids: [id], + fieldset: DEFAULT_FIELDSET, + additionalFields: [`reference_projector_id`], follow: [ { idField: `projector_ids`, + fieldset: DEFAULT_FIELDSET, follow: [ { idField: `current_projection_ids`, @@ -41,6 +44,7 @@ export const getProjectorListSubscriptionConfig: SubscriptionConfigGenerator = ( }, { idField: `preview_projection_ids`, + fieldset: DEFAULT_FIELDSET, follow: [ { idField: `content_object_id`, @@ -51,6 +55,7 @@ export const getProjectorListSubscriptionConfig: SubscriptionConfigGenerator = ( }, { idField: `history_projection_ids`, + fieldset: DEFAULT_FIELDSET, follow: [ { idField: `content_object_id`, @@ -61,14 +66,16 @@ export const getProjectorListSubscriptionConfig: SubscriptionConfigGenerator = ( } ] }, - `projector_countdown_ids`, - `projector_message_ids`, - ...MEETING_DEFAULT_PROJECTOR_IDS_KEYS, - { idField: `speaker_ids`, additionalFields: [`meeting_user_id`] }, - `list_of_speakers_ids`, + { idField: `projector_countdown_ids`, fieldset: DEFAULT_FIELDSET }, + { idField: `projector_message_ids`, fieldset: DEFAULT_FIELDSET }, + ...MEETING_DEFAULT_PROJECTOR_IDS_KEYS.map(idField => ({ + idField, + fieldset: DEFAULT_FIELDSET + })), + { idField: `speaker_ids`, fieldset: DEFAULT_FIELDSET, additionalFields: [`meeting_user_id`] }, + { idField: `list_of_speakers_ids`, fieldset: DEFAULT_FIELDSET }, { idField: `agenda_item_ids`, fieldset: [`item_number`, `content_object_id`] } - ], - additionalFields: [`reference_projector_id`] + ] }, subscriptionName: PROJECTOR_LIST_SUBSCRIPTION }); diff --git a/client/src/app/site/pages/meetings/pages/projectors/view-models/view-projector.ts b/client/src/app/site/pages/meetings/pages/projectors/view-models/view-projector.ts index ba9019849f..711f6446b8 100644 --- a/client/src/app/site/pages/meetings/pages/projectors/view-models/view-projector.ts +++ b/client/src/app/site/pages/meetings/pages/projectors/view-models/view-projector.ts @@ -5,14 +5,14 @@ import { ViewProjectorMeetingUsageKey } from 'src/app/domain/models/projector/pr import { BaseViewModel, ViewModelRelations } from 'src/app/site/base/base-view-model'; import { HasMeeting } from 'src/app/site/pages/meetings/view-models/has-meeting'; import { ViewMeeting } from 'src/app/site/pages/meetings/view-models/view-meeting'; -import { Follow } from 'src/app/site/services/model-request-builder'; +import { DEFAULT_FIELDSET, Follow } from 'src/app/site/services/model-request-builder'; import { ViewProjection } from './view-projection'; export const PROJECTOR_CONTENT_FOLLOW: Follow = { idField: `current_projection_ids`, - follow: [{ idField: `content_object_id` }], - fieldset: `content` + fieldset: `content`, + follow: [{ idField: `content_object_id`, fieldset: DEFAULT_FIELDSET }] }; export class ViewProjector extends BaseViewModel { diff --git a/client/src/app/site/pages/meetings/services/active-meeting.subscription.ts b/client/src/app/site/pages/meetings/services/active-meeting.subscription.ts index f367190409..c66f1f4012 100644 --- a/client/src/app/site/pages/meetings/services/active-meeting.subscription.ts +++ b/client/src/app/site/pages/meetings/services/active-meeting.subscription.ts @@ -4,6 +4,7 @@ import { Id } from 'src/app/domain/definitions/key-types'; import { FULL_FIELDSET, MEETING_ROUTING_FIELDS } from 'src/app/domain/fieldsets/misc'; import { UserFieldsets } from 'src/app/domain/fieldsets/user'; import { MEETING_MEDIAFILE_USAGE_ID_KEYS } from 'src/app/domain/models/meetings/meeting.constants'; +import { DEFAULT_FIELDSET } from 'src/app/site/services/model-request-builder'; import { ViewMeeting } from '../view-models/view-meeting'; @@ -36,9 +37,10 @@ export function getActiveMeetingSubscriptionConfig(id: Id, settingsKeys: string[ idField, fieldset: [`mediafile_id`] })), - { idField: `chat_group_ids` /*, fieldset: [`chat_message_ids`]*/ }, + { idField: `chat_group_ids`, fieldset: DEFAULT_FIELDSET /*, fieldset: [`chat_message_ids`]*/ }, { idField: `chat_message_ids`, + fieldset: DEFAULT_FIELDSET, follow: [ { idField: `meeting_user_id`, @@ -54,14 +56,14 @@ export function getActiveMeetingSubscriptionConfig(id: Id, settingsKeys: string[ }, // TODO: Remove and count unread messages by chat_group_ids/chat_message_ids { idField: `poll_ids`, + fieldset: [`title`, `state`, `entitled_group_ids`], follow: [ { idField: `content_object_id`, fieldset: [`title`], follow: [{ idField: `agenda_item_id`, fieldset: [`item_number`, `content_object_id`] }] } - ], - fieldset: [`title`, `state`, `entitled_group_ids`] + ] }, { idField: `point_of_order_category_ids`, diff --git a/client/src/app/site/pages/organization/organization.subscription.ts b/client/src/app/site/pages/organization/organization.subscription.ts index f4748dca32..2d633a8e89 100644 --- a/client/src/app/site/pages/organization/organization.subscription.ts +++ b/client/src/app/site/pages/organization/organization.subscription.ts @@ -56,11 +56,11 @@ function getMeetingListFollowConfig( ): any { return { idField: idField, + fieldset: `list`, follow: [ { idField: `committee_id`, fieldset: `name` }, { idField: `organization_tag_ids`, fieldset: FULL_FIELDSET } - ], - fieldset: `list` + ] }; } diff --git a/client/src/app/site/pages/organization/pages/accounts/accounts.subscription.ts b/client/src/app/site/pages/organization/pages/accounts/accounts.subscription.ts index 05a6e96736..37d31e8cb4 100644 --- a/client/src/app/site/pages/organization/pages/accounts/accounts.subscription.ts +++ b/client/src/app/site/pages/organization/pages/accounts/accounts.subscription.ts @@ -16,8 +16,8 @@ export const getAccountDetailSubscriptionConfig: SubscriptionConfigGenerator = ( { idField: `committee_ids`, fieldset: [`name`, `manager_ids`] }, { idField: `meeting_ids`, - follow: [{ idField: `group_ids`, fieldset: [`name`], isFullList: false }], - fieldset: [`name`, `committee_id`] + fieldset: [`name`, `committee_id`], + follow: [{ idField: `group_ids`, fieldset: [`name`], isFullList: false }] }, { idField: `gender_id`, fieldset: [`name`] } ] diff --git a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts index f61b7d8630..395d4a17aa 100644 --- a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts +++ b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts @@ -62,7 +62,8 @@ export const getCommitteeDetailSubscriptionConfig: SubscriptionConfigGenerator = follow: [{ idField: `meeting_user_ids`, fieldset: `groups` }] }, { - idField: `meeting_ids` + idField: `meeting_ids`, + fieldset: DEFAULT_FIELDSET } ] }, diff --git a/client/src/app/site/pages/organization/pages/mediafiles/mediafiles.subscription.ts b/client/src/app/site/pages/organization/pages/mediafiles/mediafiles.subscription.ts index de31d2e591..fe9b3afd3f 100644 --- a/client/src/app/site/pages/organization/pages/mediafiles/mediafiles.subscription.ts +++ b/client/src/app/site/pages/organization/pages/mediafiles/mediafiles.subscription.ts @@ -1,4 +1,5 @@ import { SubscriptionConfigGenerator } from 'src/app/domain/interfaces/subscription-config'; +import { DEFAULT_FIELDSET } from 'src/app/site/services/model-request-builder'; import { ORGANIZATION_ID } from '../../services/organization.service'; import { ViewOrganization } from '../../view-models/view-organization'; @@ -10,6 +11,7 @@ export const getOrganizationMediafileListSubscriptionConfig: SubscriptionConfigG modelRequest: { viewModelCtor: ViewOrganization, ids: [ORGANIZATION_ID], + fieldset: DEFAULT_FIELDSET, follow: [ { idField: `mediafile_ids`, diff --git a/client/src/app/site/pages/organization/pages/organization-tags/organization-tags.subscription.ts b/client/src/app/site/pages/organization/pages/organization-tags/organization-tags.subscription.ts index 17082e45aa..2df984d320 100644 --- a/client/src/app/site/pages/organization/pages/organization-tags/organization-tags.subscription.ts +++ b/client/src/app/site/pages/organization/pages/organization-tags/organization-tags.subscription.ts @@ -1,6 +1,7 @@ import { SubscriptionConfigGenerator } from 'src/app/domain/interfaces/subscription-config'; import { ORGANIZATION_ID } from 'src/app/site/pages/organization/services/organization.service'; import { ViewOrganization } from 'src/app/site/pages/organization/view-models/view-organization'; +import { DEFAULT_FIELDSET } from 'src/app/site/services/model-request-builder'; export const ORGANIZATION_TAG_LIST_SUBSCRIPTION = `organization_tag_list`; @@ -9,6 +10,6 @@ export const getOrganizationTagListSubscriptionConfig: SubscriptionConfigGenerat modelRequest: { viewModelCtor: ViewOrganization, ids: [ORGANIZATION_ID], - follow: [`organization_tag_ids`] + follow: [{ idField: `organization_tag_ids`, fieldset: DEFAULT_FIELDSET }] } }); From c236d2b26d8cbe4cf110ede059d4504b297e0007 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Fri, 1 Nov 2024 08:52:50 +0100 Subject: [PATCH 2/4] Fix failing test --- .../app/site/pages/meetings/pages/polls/polls.subscription.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts index 43a82e8e78..45c9b88c98 100644 --- a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts @@ -60,7 +60,6 @@ export const getPollDetailSubscriptionConfig: SubscriptionConfigGenerator = (... modelRequest: { viewModelCtor: ViewPoll, ids, - fieldset: FULL_FIELDSET, follow: [ { idField: `content_object_id`, fieldset: [`title`, ...MEETING_ROUTING_FIELDS] }, { From fa0ec7e942d308494a8ae46807f2de77af5fa542 Mon Sep 17 00:00:00 2001 From: Elblinator Date: Fri, 1 Nov 2024 10:50:42 +0100 Subject: [PATCH 3/4] readd FULL_FIELDSET --- .../app/site/pages/meetings/pages/polls/polls.subscription.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts index 45c9b88c98..43a82e8e78 100644 --- a/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts +++ b/client/src/app/site/pages/meetings/pages/polls/polls.subscription.ts @@ -60,6 +60,7 @@ export const getPollDetailSubscriptionConfig: SubscriptionConfigGenerator = (... modelRequest: { viewModelCtor: ViewPoll, ids, + fieldset: FULL_FIELDSET, follow: [ { idField: `content_object_id`, fieldset: [`title`, ...MEETING_ROUTING_FIELDS] }, { From 0ebbd8c5abab061a7ac93405566e661b49c5825f Mon Sep 17 00:00:00 2001 From: Elblinator Date: Fri, 1 Nov 2024 11:32:37 +0100 Subject: [PATCH 4/4] Revert some changes --- .../pages/committees/committees.subscription.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts index 395d4a17aa..4230a75823 100644 --- a/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts +++ b/client/src/app/site/pages/organization/pages/committees/committees.subscription.ts @@ -63,7 +63,17 @@ export const getCommitteeDetailSubscriptionConfig: SubscriptionConfigGenerator = }, { idField: `meeting_ids`, - fieldset: DEFAULT_FIELDSET + fieldset: [ + `end_time`, + `is_active_in_organization_id`, + `location`, + `locked_from_inside`, + `name`, + `organization_tag_ids`, + `start_time`, + `template_for_organization_id`, + `user_ids` + ] } ] },