Skip to content

Commit

Permalink
Remove non existing fields from autoupdate subscriptions (#2608)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom authored Aug 9, 2023
1 parent 735edde commit 1587a38
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const FontDefaults: { [place in FontPlace]: string } = {
export const FONT_PLACES = Object.keys(FontDisplayNames) as FontPlace[];

export type ViewMediafileMeetingUsageKey =
| `used_as_logo_${LogoPlace | FontPlace}_in_meeting`
| `used_as_logo_${LogoPlace}_in_meeting`
| `used_as_font_${FontPlace}_in_meeting`;

export type MediafileMeetingUsageIdKey = `${ViewMediafileMeetingUsageKey}_id`;
Expand Down
2 changes: 0 additions & 2 deletions client/src/app/domain/models/meeting-users/meeting-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export class MeetingUser extends BaseDecimalModel<MeetingUser> {
public vote_delegations_from_ids!: Id[]; // meeting_user/vote_delegated_to_id;
public chat_message_ids!: Id[]; // (chat_message/meeting_user_id)[];

public projection_ids!: any[];

public constructor(input?: Partial<MeetingUser>) {
super(MeetingUser.COLLECTION, input);
}
Expand Down
15 changes: 0 additions & 15 deletions client/src/app/domain/models/meetings/meeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export class Settings {

// TODO: Move to meeting. these are not settings anymore, if the meeting-detail-view
// in the committee-list-view is finished.
public is_template!: boolean; // Unique within a committee
public enable_anonymous!: boolean;
public language!: boolean;

Expand All @@ -40,9 +39,6 @@ export class Settings {
public jitsi_room_name!: string;
public jitsi_room_password!: string;

// Chat
public enable_chat!: boolean;

public conference_show!: boolean;
public conference_auto_connect!: boolean;
public conference_los_restriction!: boolean;
Expand Down Expand Up @@ -175,22 +171,11 @@ export class Settings {
public assignment_poll_default_backend!: PollBackendDurationType;

//topic poll
topic_poll_ballot_paper_selection: BallotPaperSelection;
topic_poll_ballot_paper_number: number;
topic_poll_add_candidates_to_list_of_speakers: boolean;
topic_poll_enable_max_votes_per_option: boolean;
topic_poll_sort_poll_result_by_votes: boolean;
topic_poll_default_type: PollType;
topic_poll_default_method: PollMethod;
topic_poll_default_onehundred_percent_base: PollPercentBase;
topic_poll_default_group_ids: Id[]; // (group/used_as_poll_default_id)[];
topic_poll_default_backend: PollBackendDurationType;

//default poll
poll_ballot_paper_selection: BallotPaperSelection;
poll_ballot_paper_number: number;
poll_add_candidates_to_list_of_speakers: boolean;
poll_enable_max_votes_per_option: boolean;
poll_sort_poll_result_by_votes: boolean;
poll_default_type: PollType;
poll_default_method: PollMethod;
Expand Down
1 change: 0 additions & 1 deletion client/src/app/domain/models/motions/motion-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class MotionWorkflow extends BaseModel<MotionWorkflow> {

public state_ids!: Id[]; // (motion_state/workflow_id)[];
public first_state_id!: Id; // motion_state/first_state_of_workflow_id;
public motion_ids!: Id[]; // (motion/workflow_id)[];
public default_workflow_meeting_id!: Id; // meeting/motions_default_workflow_id;
public default_amendment_workflow_meeting_id!: Id; // meeting/motions_default_amendment_workflow_id;
public default_statute_amendment_workflow_meeting_id!: Id; // meeting/motions_default_statute_amendments_workflow_id;
Expand Down
2 changes: 0 additions & 2 deletions client/src/app/domain/models/topics/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { HasAgendaItemId } from '../../interfaces/has-agenda-item-id';
import { HasAttachmentIds } from '../../interfaces/has-attachment-ids';
import { HasListOfSpeakersId } from '../../interfaces/has-list-of-speakers-id';
import { HasMeetingId } from '../../interfaces/has-meeting-id';
import { HasTagIds } from '../../interfaces/has-tag-ids';
import { BaseModel } from '../base/base-model';

/**
Expand Down Expand Up @@ -38,6 +37,5 @@ export interface Topic
HasAgendaItemId,
HasListOfSpeakersId,
HasAttachmentIds,
HasTagIds,
HasSequentialNumber,
HasPollIds {}
3 changes: 1 addition & 2 deletions client/src/app/domain/models/users/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';

import { Id } from '../../definitions/key-types';
import { OMLMapping } from '../../definitions/organization-permission';
import { HasProjectionIds } from '../../interfaces/has-projectable-ids';
import { BaseDecimalModel } from '../base/base-decimal-model';
/**
* Key to sort users by
Expand Down Expand Up @@ -95,4 +94,4 @@ export class User extends BaseDecimalModel<User> {
`organization_id`
];
}
export interface User extends HasProjectionIds {}
export interface User {}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export class MeetingRepositoryService extends BaseRepository<ViewMeeting, Meetin
`start_time`,
`end_time`,
`is_active_in_organization_id`,
`is_archived_organization_id`,
`template_for_organization_id`,
`meeting_user_ids`,
`description`,
Expand All @@ -71,7 +70,6 @@ export class MeetingRepositoryService extends BaseRepository<ViewMeeting, Meetin
`language`
]);
const detailEditFields: TypedFieldset<Meeting> = [
`is_template`,
`default_meeting_for_committee_id`,
`jitsi_domain`,
`jitsi_room_name`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export class TopicRepositoryService extends BaseAgendaItemAndListOfSpeakersConte
id: viewModel.id,
text: update.text,
title: update.title,
attachment_ids: update.attachment_ids || [],
tag_ids: update.tag_ids || []
attachment_ids: update.attachment_ids || []
};
return this.sendActionToBackend(TopicAction.UPDATE, payload);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ export const RELATIONS: Relation[] = [
// ########## Tags
...makeGenericM2M<ViewTag, HasTags>({
viewModel: ViewTag,
possibleViewModels: [ViewAgendaItem, ViewAssignment, ViewMotion, ViewTopic],
possibleViewModels: [ViewAgendaItem, ViewAssignment, ViewMotion],
viewModelField: `tagged`,
viewModelIdField: `tagged_ids`,
possibleViewModelsField: `tags`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,13 @@ export abstract class BasePollFormComponent extends BaseComponent implements OnI
}

private checkPollBackend(): void {
const pollType = this.data.content_object?.collection as PollClassType;
if (!this.data.backend) {
const pollType = this.data.content_object?.collection as PollClassType;
this.data.backend = this.meetingSettingService.instant(`${pollType}_poll_default_backend`);
if (pollType !== `topic`) {
this.data.backend = this.meetingSettingService.instant(`${pollType}_poll_default_backend`);
} else {
this.data.backend = this.meetingSettingService.instant(`poll_default_backend`);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,22 @@ export class TopicPollService extends PollService {
super(organizationSettingsService, translate, pollKeyVerbose, parsePollNumber, themeService);
pollServiceMapper.registerService(ViewTopic.COLLECTION, this);
this.meetingSettingsService
.get(`topic_poll_default_onehundred_percent_base`)
.get(`poll_default_onehundred_percent_base`)
.subscribe(base => (this.defaultPercentBase = base ?? PollPercentBase.Y));

this.meetingSettingsService
.get(`topic_poll_default_group_ids`)
.subscribe(ids => (this.defaultGroupIds = ids ?? []));

this.meetingSettingsService
.get(`topic_poll_default_method`)
.get(`poll_default_method`)
.subscribe(method => (this.defaultPollMethod = method ?? PollMethod.Y));

this.meetingSettingsService
.get(`topic_poll_default_type`)
.get(`poll_default_type`)
.subscribe(type => (this.defaultPollType = type ?? PollType.Pseudoanonymous));

this.meetingSettingsService
.get(`topic_poll_sort_poll_result_by_votes`)
.subscribe(sort => (this.sortByVote = sort));

this.meetingSettingsService
.get(`topic_poll_enable_max_votes_per_option`)
.subscribe(enable_max_votes_per_option => (this.enableMaxVotesPerOption = enable_max_votes_per_option));
this.meetingSettingsService.get(`poll_sort_poll_result_by_votes`).subscribe(sort => (this.sortByVote = sort));
}

public getDefaultPollData(contentObject?: Topic): Partial<Poll> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { BaseProjectableViewModel } from 'src/app/site/pages/meetings/view-model
import { HasMeeting } from 'src/app/site/pages/meetings/view-models/has-meeting';

import { HasAttachment } from '../../../../mediafiles/view-models/has-attachment';
import { HasTags } from '../../../../motions/modules/tags/view-models/has-tags';
import { HasPolls, VotingTextContext } from '../../../../polls';

export class ViewTopic extends BaseProjectableViewModel<Topic> {
Expand Down Expand Up @@ -42,7 +41,6 @@ export class ViewTopic extends BaseProjectableViewModel<Topic> {
export interface ViewTopic
extends Topic,
HasAttachment,
HasTags,
HasAgendaItem,
HasListOfSpeakers,
HasMeeting,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MotionWorkflow } from 'src/app/domain/models/motions/motion-workflow';
import { BaseViewModel } from 'src/app/site/base/base-view-model';
import { ViewMotion, ViewMotionState } from 'src/app/site/pages/meetings/pages/motions';
import { ViewMotionState } from 'src/app/site/pages/meetings/pages/motions';
import { HasMeeting } from 'src/app/site/pages/meetings/view-models/has-meeting';
import { ViewMeeting } from 'src/app/site/pages/meetings/view-models/view-meeting';

Expand All @@ -19,7 +19,6 @@ export class ViewMotionWorkflow extends BaseViewModel<MotionWorkflow> {
interface IWorkflowRelations {
states: ViewMotionState[];
first_state: ViewMotionState;
motions: ViewMotion[];
default_workflow_meeting?: ViewMeeting;
default_amendment_workflow_meeting?: ViewMeeting;
default_statute_amendment_workflow_meeting?: ViewMeeting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const getMotionListSubscriptionConfig: SubscriptionConfigGenerator = (id:
`state_extension_reference_ids`,
`state_id`,
`submitter_ids`,
`supporter_ids`,
`tag_ids`,
`title`
],
Expand All @@ -74,8 +73,7 @@ export const getMotionListSubscriptionConfig: SubscriptionConfigGenerator = (id:
}
]
}
],
additionalFields: [`origin_id`, `origin_meeting_id`, `derived_motion_ids`]
]
},
subscriptionName: MOTION_LIST_SUBSCRIPTION
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export function getActiveMeetingSubscriptionConfig(id: Id, settingsKeys: string[
`start_time`,
`end_time`,
`is_active_in_organization_id`,
`is_archived_organization_id`,
`template_for_organization_id`,
`user_ids`,
`description`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class ViewMeeting extends BaseHasMeetingUsersViewModel<Meeting> {
}

public get isTemplate(): boolean {
return this.is_template || !!this.template_for_organization_id;
return !!this.template_for_organization_id;
}

public get relatedTime(): RelatedTime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const getCommitteeMeetingDetailSubscriptionConfig: SubscriptionConfigGene
ids: [id],
fieldset: [],
additionalFields: [
`is_template`,
`default_meeting_for_committee_id`,
`jitsi_domain`,
`jitsi_room_name`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const meetingFields: (keyof Meeting)[] = [
`end_time`,
`committee_id`,
`is_active_in_organization_id`,
`is_archived_organization_id`,
`template_for_organization_id`,
`description`,
`location`,
Expand Down

0 comments on commit 1587a38

Please sign in to comment.