diff --git a/client/src/app/domain/definitions/permission-relations.ts b/client/src/app/domain/definitions/permission-relations.ts index 6e2d69dc15..d4d712b382 100644 --- a/client/src/app/domain/definitions/permission-relations.ts +++ b/client/src/app/domain/definitions/permission-relations.ts @@ -4,10 +4,8 @@ import { PermissionsMap } from './permission.config'; export const permissionChildren: PermissionsMap = { 'agenda_item.can_manage': [Permission.agendaItemCanSeeInternal, Permission.agendaItemCanSee], - 'agenda_item.can_manage_moderator_notes': [Permission.agendaItemCanSeeModeratorNotes, Permission.agendaItemCanSee], 'agenda_item.can_see': [], 'agenda_item.can_see_internal': [Permission.agendaItemCanSee], - 'agenda_item.can_see_moderator_notes': [Permission.agendaItemCanSee], 'assignment.can_manage': [Permission.assignmentCanNominateOther, Permission.assignmentCanSee], 'assignment.can_nominate_other': [Permission.assignmentCanSee], 'assignment.can_nominate_self': [Permission.assignmentCanSee], @@ -16,6 +14,8 @@ export const permissionChildren: PermissionsMap = { 'list_of_speakers.can_be_speaker': [], 'list_of_speakers.can_manage': [Permission.listOfSpeakersCanSee], 'list_of_speakers.can_see': [], + 'list_of_speakers.can_see_moderator_notes': [], + 'list_of_speakers.can_manage_moderator_notes': [Permission.listOfSpeakersCanSeeModeratorNotes], 'mediafile.can_manage': [Permission.mediafileCanSee], 'mediafile.can_see': [], 'meeting.can_manage_logos_and_fonts': [], @@ -59,15 +59,8 @@ export const permissionChildren: PermissionsMap = { export const permissionParents: PermissionsMap = { 'agenda_item.can_manage': [], - 'agenda_item.can_manage_moderator_notes': [], - 'agenda_item.can_see': [ - Permission.agendaItemCanSeeInternal, - Permission.agendaItemCanManage, - Permission.agendaItemCanSeeModeratorNotes, - Permission.agendaItemCanManageModeratorNotes - ], + 'agenda_item.can_see': [Permission.agendaItemCanSeeInternal, Permission.agendaItemCanManage], 'agenda_item.can_see_internal': [Permission.agendaItemCanManage], - 'agenda_item.can_see_moderator_notes': [Permission.agendaItemCanManageModeratorNotes], 'assignment.can_manage': [], 'assignment.can_nominate_other': [Permission.assignmentCanManage], 'assignment.can_nominate_self': [], @@ -79,7 +72,13 @@ export const permissionParents: PermissionsMap = { 'chat.can_manage': [], 'list_of_speakers.can_be_speaker': [], 'list_of_speakers.can_manage': [], - 'list_of_speakers.can_see': [Permission.listOfSpeakersCanManage], + 'list_of_speakers.can_see': [ + Permission.listOfSpeakersCanManage, + Permission.listOfSpeakersCanSeeModeratorNotes, + Permission.listOfSpeakersCanManageModeratorNotes + ], + 'list_of_speakers.can_see_moderator_notes': [Permission.listOfSpeakersCanManageModeratorNotes], + 'list_of_speakers.can_manage_moderator_notes': [], 'mediafile.can_manage': [], 'mediafile.can_see': [Permission.mediafileCanManage], 'meeting.can_manage_logos_and_fonts': [], diff --git a/client/src/app/domain/definitions/permission.config.ts b/client/src/app/domain/definitions/permission.config.ts index d4e77a95b0..bea38258b2 100644 --- a/client/src/app/domain/definitions/permission.config.ts +++ b/client/src/app/domain/definitions/permission.config.ts @@ -88,12 +88,12 @@ Optional combination of requests to speak with presence status is possible. ( > { display_name: _(`Can see moderation notes`), help_text: _(`Can see all moderation notes in each list of speakers.`), - value: Permission.agendaItemCanSeeModeratorNotes + value: Permission.listOfSpeakersCanSeeModeratorNotes }, { display_name: _(`Can manage moderation notes`), help_text: _(`Can edit all moderation notes.`), - value: Permission.agendaItemCanManageModeratorNotes + value: Permission.listOfSpeakersCanManageModeratorNotes } ] }, diff --git a/client/src/app/domain/definitions/permission.ts b/client/src/app/domain/definitions/permission.ts index 9b7979e098..34e4155aa9 100644 --- a/client/src/app/domain/definitions/permission.ts +++ b/client/src/app/domain/definitions/permission.ts @@ -5,10 +5,8 @@ */ export enum Permission { agendaItemCanManage = `agenda_item.can_manage`, - agendaItemCanManageModeratorNotes = `agenda_item.can_manage_moderator_notes`, agendaItemCanSee = `agenda_item.can_see`, agendaItemCanSeeInternal = `agenda_item.can_see_internal`, - agendaItemCanSeeModeratorNotes = `agenda_item.can_see_moderator_notes`, assignmentCanManage = `assignment.can_manage`, assignmentCanNominateOther = `assignment.can_nominate_other`, assignmentCanNominateSelf = `assignment.can_nominate_self`, @@ -17,6 +15,8 @@ export enum Permission { listOfSpeakersCanBeSpeaker = `list_of_speakers.can_be_speaker`, listOfSpeakersCanManage = `list_of_speakers.can_manage`, listOfSpeakersCanSee = `list_of_speakers.can_see`, + listOfSpeakersCanSeeModeratorNotes = `list_of_speakers.can_see_moderator_notes`, + listOfSpeakersCanManageModeratorNotes = `list_of_speakers.can_manage_moderator_notes`, mediafileCanManage = `mediafile.can_manage`, mediafileCanSee = `mediafile.can_see`, meetingCanManageLogosAndFonts = `meeting.can_manage_logos_and_fonts`, diff --git a/client/src/app/domain/models/agenda/agenda-item.ts b/client/src/app/domain/models/agenda/agenda-item.ts index f617f96157..6caeaf72cc 100644 --- a/client/src/app/domain/models/agenda/agenda-item.ts +++ b/client/src/app/domain/models/agenda/agenda-item.ts @@ -63,7 +63,6 @@ export class AgendaItem extends BaseModel { `closed`, `type`, `duration`, - `moderator_notes`, `is_internal`, `is_hidden`, `level`, diff --git a/client/src/app/domain/models/list-of-speakers/list-of-speakers.ts b/client/src/app/domain/models/list-of-speakers/list-of-speakers.ts index 5cfe57f130..37f9bb63d7 100644 --- a/client/src/app/domain/models/list-of-speakers/list-of-speakers.ts +++ b/client/src/app/domain/models/list-of-speakers/list-of-speakers.ts @@ -13,6 +13,8 @@ export class ListOfSpeakers extends BaseModel { public closed!: boolean; + public moderator_notes: string; + public content_object_id!: Fqid; // */list_of_speakers_id; public speaker_ids!: Id[]; // (speaker/list_of_speakers_id)[]; @@ -30,7 +32,8 @@ export class ListOfSpeakers extends BaseModel { `speaker_ids`, `structure_level_list_of_speakers_ids`, `projection_ids`, - `meeting_id` + `meeting_id`, + `moderator_notes` ]; } export interface ListOfSpeakers extends HasMeetingId, HasProjectionIds, HasSequentialNumber {} diff --git a/client/src/app/gateways/repositories/list-of-speakers/list-of-speakers-repository.service.ts b/client/src/app/gateways/repositories/list-of-speakers/list-of-speakers-repository.service.ts index 124ec10c58..ec84e2f4d4 100644 --- a/client/src/app/gateways/repositories/list-of-speakers/list-of-speakers-repository.service.ts +++ b/client/src/app/gateways/repositories/list-of-speakers/list-of-speakers-repository.service.ts @@ -94,4 +94,33 @@ export class ListOfSpeakersRepositoryService extends BaseMeetingRelatedRepositor const payload = listOfSpeakers.finishedSpeakers.map(speaker => ({ id: speaker.id })); return await this.sendBulkActionToBackend(SpeakerAction.DELETE, payload); } + + /** + * Saves the (full) update to an existing model. So called "update"-function + * Provides a default procedure, but can be overwritten if required + * + * @param update the update that should be created + * @param viewModel the view model that the update is based on + */ + public async update(update: Partial, viewModel: ViewListOfSpeakers): Promise { + const payload: any = { + id: viewModel.id, + moderator_notes: update.moderator_notes + }; + await this.createAction(ListOfSpeakersAction.UPDATE, payload).resolve(); + } + + private getOptionalPayload(content: any): any { + return { + item_number: content.item_number, + parent_id: content.parent_id, + comment: content.comment, + moderator_notes: content.moderator_notes, + closed: content.closed, + type: content.type, + duration: content.duration, + weight: content.weight, + tag_ids: content.tag_ids + }; + } } diff --git a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/moderation-note/moderation-note.component.html b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/moderation-note/moderation-note.component.html index c58932b8ac..95cc5743d9 100644 --- a/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/moderation-note/moderation-note.component.html +++ b/client/src/app/site/pages/meetings/modules/list-of-speakers-content/components/moderation-note/moderation-note.component.html @@ -1,5 +1,5 @@ -@if (agendaItem && canSeeModerationNote && (canManageModerationNote || (moderatorNotes | async))) { +@if (listOfSpeakers && canSeeModerationNote && (canManageModerationNote || (moderatorNotes | async))) { @@ -37,7 +37,7 @@ } @if (!isEditing) { -