diff --git a/client/package-lock.json b/client/package-lock.json index ea8ce4827a..f316e29b2c 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -64,7 +64,7 @@ "ngx-material-timepicker": "^13.1.1", "ngx-papaparse": "^8.0.0", "pdfjs-dist": "^4.6.82", - "pdfmake": "^0.2.12", + "pdfmake": "^0.2.14", "pofile": "^1.1.4", "qrcode": "^1.5.4", "rxjs": "^7.8.1", @@ -14259,9 +14259,9 @@ } }, "node_modules/pdfmake": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/pdfmake/-/pdfmake-0.2.12.tgz", - "integrity": "sha512-TFsqaG6KVtk+TWermmJNNwom3wmB/xiz07prM74KBhdM+7pz3Uwq2b0uoqhhQRn6cYUTpL8lXZY6xF011o1YcQ==", + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/pdfmake/-/pdfmake-0.2.14.tgz", + "integrity": "sha512-x9gXFAY37/CAC/WaZB/683E4Pi0cVW/RMTTNxMpe4I2kRsKv8AE3Pz6+n7iTfn+84/GtSg99BjZkYh7oGFCKmg==", "dependencies": { "@foliojs-fork/linebreak": "^1.1.1", "@foliojs-fork/pdfkit": "^0.14.0", @@ -14269,7 +14269,7 @@ "xmldoc": "^1.1.2" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/picocolors": { diff --git a/client/package.json b/client/package.json index d59f15c14d..9ae35bb9f4 100644 --- a/client/package.json +++ b/client/package.json @@ -91,7 +91,7 @@ "ngx-material-timepicker": "^13.1.1", "ngx-papaparse": "^8.0.0", "pdfjs-dist": "^4.6.82", - "pdfmake": "^0.2.12", + "pdfmake": "^0.2.14", "pofile": "^1.1.4", "qrcode": "^1.5.4", "rxjs": "^7.8.1", diff --git a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/amendment-paragraph-unified-change.ts b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/amendment-paragraph-unified-change.ts index bf27087f30..b24705c9a8 100644 --- a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/amendment-paragraph-unified-change.ts +++ b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/amendment-paragraph-unified-change.ts @@ -13,6 +13,7 @@ export class AmendmentParagraphUnifiedChange implements ViewUnifiedChange { public type!: number; public merge_amendment_into_final: MergeAmendment; public merge_amendment_into_diff: MergeAmendment; + public amend_nr: string; public constructor( data: AmendmentData, @@ -23,6 +24,7 @@ export class AmendmentParagraphUnifiedChange implements ViewUnifiedChange { this.id = data.id; this.merge_amendment_into_final = data.merge_amendment_into_final; this.merge_amendment_into_diff = data.merge_amendment_into_diff; + this.amend_nr = data.number; } public getTitle(): string { diff --git a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.scss b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.scss index 29b6681642..df4918500f 100644 --- a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.scss +++ b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.scss @@ -71,3 +71,24 @@ } } } + +.amendment-nr-n-icon { + display: flex; + align-items: center; + justify-content: flex-start; + position: relative; + left: -40px; + height: 1.5em; + margin-top: 25px; +} + +.amendment-nr { + position: relative; + font-style: italic; + background-color: rgb(224, 224, 224); + padding-right: 4px; +} + +.os-linebreak { + display: none !important; +} diff --git a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.ts b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.ts index ea12db83e0..8ec7f07f41 100644 --- a/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.ts +++ b/client/src/app/site/pages/meetings/modules/projector/modules/slides/components/motions/modules/motion-slide/components/motion-slide/motion-slide.component.ts @@ -370,7 +370,7 @@ export class MotionSlideComponent return html; } - public getAllTextChangingObjects(): ViewUnifiedChange[] { + private getAllTextChangingObjects(): ViewUnifiedChange[] { return this.allChangingObjects.filter((obj: ViewUnifiedChange) => !obj.isTitleChange()); } diff --git a/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts b/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts index 586ba427e1..a8038be15c 100644 --- a/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts @@ -1,7 +1,8 @@ import { Injectable } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; import { Id } from 'src/app/domain/definitions/key-types'; import { MotionFormattingRepresentation } from 'src/app/domain/models/motions/motion'; -import { ChangeRecoMode } from 'src/app/domain/models/motions/motions.constants'; +import { ChangeRecoMode, LineNumberingMode } from 'src/app/domain/models/motions/motions.constants'; import { MeetingSettingsService } from 'src/app/site/pages/meetings/services/meeting-settings.service'; import { ViewUnifiedChange, ViewUnifiedChangeType } from '../../../modules'; @@ -68,7 +69,8 @@ export class MotionFormatService { private diffService: MotionDiffService, private amendmentController: AmendmentControllerService, private changeRecoRepo: MotionChangeRecommendationControllerService, - private settings: MeetingSettingsService + private settings: MeetingSettingsService, + private translate: TranslateService ) {} /** @@ -215,7 +217,7 @@ export class MotionFormatService { private getDiffView = (targetMotion: MotionFormattingRepresentation, args: DifferedViewArguments): string => { const { changes, lineLength, highlightedLine, firstLine }: DifferedViewArguments = args; - const text = []; + const text: string[] = []; const changesToShow = changes.filter(change => change.showInDiffView()); const motionText = this.lineNumberingService.insertLineNumbers({ html: targetMotion.text, @@ -239,7 +241,7 @@ export class MotionFormatService { ) ); } - + text.push(this.addAmendmentNr(changesToShow, changesToShow[i])); text.push(this.diffService.getChangeDiff(motionText, changesToShow[i], lineLength, highlightedLine)); lastLineTo = changesToShow[i].getLineTo(); } @@ -247,6 +249,63 @@ export class MotionFormatService { text.push( this.diffService.getTextRemainderAfterLastChange(motionText, changesToShow, lineLength, highlightedLine) ); - return text.join(``); + return this.adjustDiffClasses(text).join(``); }; + + private addAmendmentNr(changesToShow: ViewUnifiedChange[], current_text: ViewUnifiedChange): string { + const lineNumbering = this.settings.instant(`motions_default_line_numbering`); + const amendmentNr: string[] = []; + + if (this.diffService.changeHasCollissions(current_text, changesToShow)) { + if (lineNumbering === LineNumberingMode.Outside) { + amendmentNr.push( + `warning` + ); + } else if (lineNumbering === LineNumberingMode.Inside) { + amendmentNr.push( + `warning` + ); + } else { + amendmentNr.push( + `warning` + ); + } + } else { + if (lineNumbering === LineNumberingMode.Outside) { + amendmentNr.push(``); + } else if (lineNumbering === LineNumberingMode.Inside) { + amendmentNr.push(``); + } else { + amendmentNr.push(``); + } + } + amendmentNr.push(``); + if (`amend_nr` in current_text) { + if (typeof current_text.amend_nr === `string`) { + amendmentNr.push(current_text.amend_nr); + } + if (current_text.amend_nr === ``) { + amendmentNr.push(this.translate.instant(`Amendment`)); + } + } else { + amendmentNr.push(this.translate.instant(`Change recommendation`)); + } + amendmentNr.push(`: `); + return amendmentNr.join(``); + } + + private adjustDiffClasses(text: string[]): string[] { + for (let i = 0; i < text.length; i++) { + // Removes the unwanted gap between the paragraph and the amendment number + if (text[i]?.indexOf(`amendment-nr-n-icon`) !== -1) { + text[i + 1] = text[i + 1]?.replace(`os-split-after`, `os-split-after margin-top-0`); + text[i + 1] = text[i + 1]?.replace(`

`, `

`); + } + + if (text[i]?.search(` -1) { + text[i] = text[i].replace(/ class="os-line-number line-number-[1-9]+"/, ``); + } + } + return text; + } } diff --git a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.html b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.html index 1f7182dba1..84661eca53 100644 --- a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.html +++ b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.html @@ -158,7 +158,7 @@

{{ 'Committees and meetings' | translate }}

@for (row of tableData | keyvalue: tableDataAscOrderCompare; track row; let lastLine = $last) { @if (!getNumberOfKeys(row.value.meetings)) { - + {{ row.value.committee_name }} @@ -184,7 +184,7 @@

{{ 'Committees and meetings' | translate }}

let isFirst = $first; let isLast = $last ) { - + @if (isFirst) { @@ -204,12 +204,12 @@

{{ 'Committees and meetings' | translate }}

} } - +
{{ meeting_row.value.meeting_name }} - + @for (group of meeting_row.value.group_names; track group; let lastGroup = $last) { {{ group }}{{ !lastGroup ? ', ' : '' }} } diff --git a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.scss b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.scss index 231f090b96..3bed440a0f 100644 --- a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.scss +++ b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.scss @@ -38,4 +38,8 @@ os-user-detail-view h2 { .committee-underline { border-bottom: 1px solid rgba(153, 153, 153, 0.5); } + + .word-break { + word-break: break-word; + } } diff --git a/client/src/app/ui/modules/editor/components/editor/extensions/office.ts b/client/src/app/ui/modules/editor/components/editor/extensions/office.ts index ca1e5c068d..28be4d464a 100644 --- a/client/src/app/ui/modules/editor/components/editor/extensions/office.ts +++ b/client/src/app/ui/modules/editor/components/editor/extensions/office.ts @@ -15,13 +15,13 @@ export const MSOfficePaste = Extension.create({ const OfficePastePlugin = new Plugin({ props: { transformPastedHTML(html: string): string { - console.log([html]); + console.debug([html]); if (html.indexOf(`microsoft-com`) !== -1 && html.indexOf(`office`) !== -1) { html = transformLists(html); html = transformRemoveBookmarks(html); html = transformMsoStyles(html); } - console.log([html]); + console.debug([html]); return html; } } diff --git a/client/src/meta b/client/src/meta index f010fd2c34..21bc4fd12a 160000 --- a/client/src/meta +++ b/client/src/meta @@ -1 +1 @@ -Subproject commit f010fd2c346353413a191abb3fbcd89888d6ffc6 +Subproject commit 21bc4fd12a604933cd8732a130e973e34835f541