diff --git a/client/src/app/gateways/repositories/users/user-repository.service.ts b/client/src/app/gateways/repositories/users/user-repository.service.ts index e37a25e73e..8db4e0c488 100644 --- a/client/src/app/gateways/repositories/users/user-repository.service.ts +++ b/client/src/app/gateways/repositories/users/user-repository.service.ts @@ -148,7 +148,7 @@ export class UserRepositoryService extends BaseRepository { const data = usersToCreate.map(user => { const meetingUsers = user.meeting_users as Partial[]; return { - user: this.sanitizePayload(this.getBaseUserPayload(user), true), + user: this.sanitizePayload(this.getBaseUserPayloadCreate(user), true), ...(meetingUsers && meetingUsers.length ? { first_meeting_user: this.sanitizePayload( @@ -213,7 +213,7 @@ export class UserRepositoryService extends BaseRepository { const updates = Array.isArray(dirtyUpdate) ? dirtyUpdate : [dirtyUpdate]; return updates.map(update => ({ id: user.id, - ...this.sanitizePayload(this.getBaseUserPayload(update)), + ...this.sanitizePayload(this.getBaseUserPayloadUpdate(update)), ...this.sanitizePayload(this.meetingUserRepo.getBaseUserPayload(update)) })); }); @@ -248,7 +248,7 @@ export class UserRepositoryService extends BaseRepository { return this.createAction(UserAction.ASSIGN_MEETINGS, payload); } - private getBaseUserPayload(partialUser: Partial): any { + private getBaseUserPayloadUpdate(partialUser: Partial): any { const partialPayload: Partial = { pronoun: partialUser.pronoun, title: partialUser.title, @@ -269,6 +269,12 @@ export class UserRepositoryService extends BaseRepository { return partialPayload; } + private getBaseUserPayloadCreate(partialUser: Partial): any { + const partialPayload = this.getBaseUserPayloadUpdate(partialUser); + partialPayload.is_present_in_meeting_ids = partialUser.is_present_in_meeting_ids; + return partialPayload; + } + public getTitle = (viewUser: ViewUser): string => this.getFullName(viewUser); /** diff --git a/client/src/app/site/base/base.component.ts b/client/src/app/site/base/base.component.ts index 7f8bcd2bab..968e80be8d 100644 --- a/client/src/app/site/base/base.component.ts +++ b/client/src/app/site/base/base.component.ts @@ -93,9 +93,12 @@ export abstract class BaseComponent extends BaseUiComponent implements OnDestroy * Set the title in web browser using angulars TitleService * @param prefix The title prefix. Should be translated here. */ - public setTitle(prefix: string): void { - const translatedPrefix = this.translate.instant(prefix); - this.titleService.setTitle(translatedPrefix + this.titleSuffix); + public setTitle(prefix: string, nonTranslate?: boolean): void { + let titlePrefix = prefix; + if (!nonTranslate) { + titlePrefix = this.translate.instant(prefix); + } + this.titleService.setTitle(titlePrefix + this.titleSuffix); } /** diff --git a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts index 191bdb36aa..d96d4ea9bc 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/modules/topics/pages/topic-detail/components/topic-detail/topic-detail.component.ts @@ -280,7 +280,7 @@ export class TopicDetailComponent extends BaseMeetingComponent implements OnInit // also ensures edition cannot be interrupted by autoupdate if (newViewTopic) { const title = newViewTopic.getListTitle(); - super.setTitle(title); + super.setTitle(title, true); this.topic = newViewTopic; // personalInfoForm is undefined during 'new' and directly after reloading if (!this.editTopic) { diff --git a/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts b/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts index dda6004960..52056f4935 100644 --- a/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts +++ b/client/src/app/site/pages/meetings/pages/assignments/pages/assignment-detail/components/assignment-detail/assignment-detail.component.ts @@ -200,7 +200,7 @@ export class AssignmentDetailComponent extends BaseMeetingComponent implements O this.assignmentRepo.getViewModelObservable(assignmentId).subscribe(assignment => { if (assignment) { const title = assignment.getTitle(); - super.setTitle(title); + super.setTitle(title, true); this.assignment = assignment; if (!this.isEditing) { this.patchForm(this.assignment); diff --git a/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html b/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html index b4b984b6f8..d51dd74402 100644 --- a/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html +++ b/client/src/app/site/pages/meetings/pages/autopilot/components/autopilot/autopilot.component.html @@ -36,7 +36,7 @@

{{ 'Autopilot' | translate }}

[target]="lowerProjectionTarget" >

- {{ title | translate }} + {{ title }}

diff --git a/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.spec.ts b/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.spec.ts index 013fc6eea8..c1e79b225b 100644 --- a/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.spec.ts +++ b/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.spec.ts @@ -1186,6 +1186,30 @@ describe(`MotionDiffService`, () => { } )); + it(`does not fall back to block level replacement when replacement and tag insertion overlap (3)`, inject( + [MotionDiffService], + (service: MotionDiffService) => { + const before = `

es war ihnen wie eine Bestätigung ihrer neuen Träume und guten Absichten, als am Ziele ihrer Fahrt die Tochter als erste sich erhob und ihren jungen Körper dehnte.

`, + after = `

es war ihnen wie eine Bestätigung NEU NEU2 ihrer neuen Träume und guten Absichten, als am Ziele ihrer Fahrt die Tochter als erste sich erhob und ihren jungen Körper dehnte.

`; + const diff = service.diff(before, after); + expect(diff).toBe( + `

es war ihnen wie eine Bestätigung NEU NEU2 ihrer neuen Träume und guten Absichten, als am Ziele ihrer Fahrt die Tochter als erste sich erhob und ihren jungen Körper dehnte.

` + ); + } + )); + + it(`does not fall back to block level replacement when replacement and tag insertion overlap (4)`, inject( + [MotionDiffService], + (service: MotionDiffService) => { + const before = `

Und es war ihnen wie eine Bestätigung ihrer neuen Träume und guten Absichten, als am Ziele ihrer Fahrt die Tochter als erste sich erhob und ihren jungen Körper dehnte.

`, + after = `

Und es war ihnen wie eine Bestätigung ihrer neuen Träume und guten Absichten, als am Ziele ihrer Fahrt die Tochter als erste sich erhob und ihren jungen alten Körpergehülle dehnte.

`; + const diff = service.diff(before, after); + expect(diff).toBe( + `

Und es war ihnen wie eine Bestätigung ihrer neuen Träume und guten Absichten, als am Ziele ihrer Fahrt die Tochter als erste sich erhob und ihren jungen alten KörperKörpergehülle dehnte.

` + ); + } + )); + it(`works with multiple inserted paragraphs`, inject([MotionDiffService], (service: MotionDiffService) => { const before = `

This is the text before

`, after = `

This is the text before

\n

This is one added line

\n

Another added line

`; diff --git a/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.ts b/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.ts index c98c823d46..39dd6a1677 100644 --- a/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/modules/change-recommendations/services/motion-diff.service/motion-diff.service.ts @@ -1581,7 +1581,7 @@ export class MotionDiffService { // formatted => formattedformatted diffUnnormalized = diffUnnormalized.replace( - /<(span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?><\/ins>([^<]*)<\/\1><\/ins>/gi, + /<(mark|span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?><\/ins>([^<]*)<\/\1><\/ins>/gi, (_whole: string, inlineTag: string, tagAttributes: string, content: string): string => `` + content + @@ -1598,7 +1598,7 @@ export class MotionDiffService { // formatted => formattedformatted diffUnnormalized = diffUnnormalized.replace( - /<(span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?><\/del>([^<]*)<\/\1><\/del>/gi, + /<(mark|span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?><\/del>([^<]*)<\/\1><\/del>/gi, (_whole: string, inlineTag: string, tagAttributes: string, content: string): string => `<` + inlineTag + @@ -1613,10 +1613,36 @@ export class MotionDiffService { `` ); + // Körperalten Körpergehülle => alten KörperKörpergehülle + diffUnnormalized = diffUnnormalized.replace( + /<(mark|span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?>([^<]*)<\/del>([^<]*)<\1>([^<]*)<\/ins><\/\1>/gi, + ( + _whole: string, + inlineTag: string, + tagAttributes: string, + delContent: string, + insContent1: string, + insContent2: string + ): string => + `` + + insContent1 + + `<` + + inlineTag + + (tagAttributes ? tagAttributes : ``) + + `>` + + delContent + + `` + + `` + + insContent2 + + `` + ); + // with a a unformatted wordsentence -> // unformatted wordformatted word diffUnnormalized = diffUnnormalized.replace( - /([^<]*)<\/del><(span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?>([^<]*)<\/ins>([^<]*)<\/\2><\/ins>/gi, + /([^<]*)<\/del><(mark|span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?>([^<]*)<\/ins>([^<]*)<\/\2><\/ins>/gi, ( _whole: string, delContent: string, @@ -1642,7 +1668,7 @@ export class MotionDiffService { // unformatted wordsentence -> // unformatted wordunformatted sentence diffUnnormalized = diffUnnormalized.replace( - /<(span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?><\/ins>([^<]*)([^<]*)<\/del>([^<]*)<\/\1><\/ins>/gi, + /<(mark|span|strong|em|b|i|u|s|a|small|big|sup|sub)( [^>]*)?><\/ins>([^<]*)([^<]*)<\/del>([^<]*)<\/\1><\/ins>/gi, ( _whole: string, inlineTag: string, @@ -1665,6 +1691,19 @@ export class MotionDiffService { `>` ); + // Bestätigung NEU NEU2 --> + // Bestätigung NEU NEU2 + diffUnnormalized = diffUnnormalized.replace( + /(<\/(mark|span|strong|em|b|i|u|s|a|small|big|sup|sub)>)<\/del>([^>]*)<\/\2>([^>]*)<\/ins>/gi, + ( + _whole: string, + closingTag: string, + closingTagInner: string, + insertedText1: string, + insertedText2: string + ): string => `` + insertedText1 + `` + closingTag + `` + insertedText2 + `` + ); + // Ebene 3
  •  Ebene 3a
    • // => Ebene 3 Ebene 3a
      •   diffUnnormalized = diffUnnormalized.replace( diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts index af6e6174ae..f04422a30f 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-view/components/motion-view/motion-view.component.ts @@ -231,7 +231,7 @@ export class MotionViewComponent extends BaseMeetingComponent implements OnInit, public onMotionUpdated(motion: ViewMotion): void { const title = motion.getTitle(); - super.setTitle(title); + super.setTitle(title, true); this.motion = motion; this.cd.markForCheck(); } diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts index 93cd1118e6..00d17206dd 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/components/participant-detail-view/participant-detail-view.component.ts @@ -279,7 +279,7 @@ export class ParticipantDetailViewComponent extends BaseMeetingComponent { this.repo.getViewModelObservable(this._userId!).subscribe(user => { if (user) { const title = user.getTitle(); - super.setTitle(title); + super.setTitle(title, true); this.user = user; this.cd.markForCheck(); } diff --git a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.ts b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.ts index 8d969f8ff2..291412a9d5 100644 --- a/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/pages/participant-detail/pages/participant-detail-manage/components/participant-create-wizard/participant-create-wizard.component.ts @@ -67,7 +67,7 @@ export class ParticipantCreateWizardComponent extends BaseMeetingComponent imple public get patchFormValueFn(): (controlName: string, user?: ViewUser) => any | null { return (controlName, user) => { if (controlName === `is_present`) { - return user?.isPresentInMeeting ? user.isPresentInMeeting() : true; + return user?.isPresentInMeeting ? user.isPresentInMeeting() : false; } return null; }; @@ -286,6 +286,9 @@ export class ParticipantCreateWizardComponent extends BaseMeetingComponent imple id: this._accountId }) .resolve(); + if (this.personalInfoFormValue.is_present) { + this.repo.setPresent(true, { ...payload, id: this._accountId }).resolve(); + } } else { this.repo.create(payload); } diff --git a/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts b/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts index 28a7e656dc..8ae1f60cc6 100644 --- a/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts +++ b/client/src/app/site/pages/meetings/pages/projectors/modules/projector-detail/components/projector-detail/projector-detail.component.ts @@ -349,7 +349,7 @@ export class ProjectorDetailComponent extends BaseMeetingComponent implements On this.repo.getViewModelObservable(this._projectorId!).subscribe(projector => { if (projector) { const title = projector.name; - super.setTitle(title); + super.setTitle(title, true); this.projector = projector; } })