Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tag_ids and agenda_type to agenda item duplication #2544

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 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 All @@ -30,7 +29,6 @@ export class Topic extends BaseModel<Topic> {
`attachment_ids`,
`agenda_item_id`,
`list_of_speakers_id`,
`tag_ids`,
`meeting_id`
];
}
Expand All @@ -39,6 +37,5 @@ export interface Topic
HasAgendaItemId,
HasListOfSpeakersId,
HasAttachmentIds,
HasTagIds,
HasSequentialNumber,
HasPollIds {}
3 changes: 2 additions & 1 deletion client/src/app/gateways/repositories/agenda/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function createAgendaItem(model: any): any {
agenda_duration: parseInt(model.agenda_duration, 10) || undefined,
agenda_parent_id: model.agenda_parent_id,
agenda_type: model.agenda_type,
agenda_weight: model.agenda_weight
agenda_weight: model.agenda_weight,
agenda_tag_ids: model.tag_ids
};
}
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 Expand Up @@ -69,7 +68,8 @@ export class TopicRepositoryService extends BaseAgendaItemAndListOfSpeakersConte
agenda_parent_id: topicAgendaItem.parent_id,
agenda_weight: topicAgendaItem.weight,
agenda_comment: topicAgendaItem.comment,
agenda_duration: topicAgendaItem.duration
agenda_duration: topicAgendaItem.duration,
tag_ids: topicAgendaItem.tag_ids
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,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 @@ -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
Expand Up @@ -398,7 +398,7 @@ export class AgendaItemListComponent extends BaseMeetingListViewComponent<ViewAg
this.modelRequestService
.fetch(getTopicDuplicateSubscriptionConfig(...filteredItems.map(el => el.content_object.id)))
.then(() => {
this.topicRepo.duplicateTopics(...filteredItems);
this.topicRepo.duplicateTopics(...filteredItems.map(item => this.repo.getViewModel(item.id)));
});
}

Expand Down