Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 4380-restrictor-change
Browse files Browse the repository at this point in the history
  • Loading branch information
Elblinator committed Dec 13, 2024
2 parents e996062 + 1b77291 commit d545861
Show file tree
Hide file tree
Showing 85 changed files with 1,413 additions and 2,333 deletions.
1,245 changes: 650 additions & 595 deletions client/package-lock.json

Large diffs are not rendered by default.

86 changes: 43 additions & 43 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,44 +36,44 @@
"get-available-languages": "npm run ts -- cli/get-available-languages.ts"
},
"dependencies": {
"@angular/animations": "^18.2.12",
"@angular/animations": "^18.2.13",
"@angular/cdk": "^18.2.14",
"@angular/common": "^18.2.12",
"@angular/compiler": "^18.2.12",
"@angular/core": "^18.2.12",
"@angular/forms": "^18.2.12",
"@angular/common": "^18.2.13",
"@angular/compiler": "^18.2.13",
"@angular/core": "^18.2.13",
"@angular/forms": "^18.2.13",
"@angular/material": "^18.2.14",
"@angular/material-date-fns-adapter": "^18.2.14",
"@angular/platform-browser": "^18.2.12",
"@angular/platform-browser-dynamic": "^18.2.12",
"@angular/router": "^18.2.12",
"@angular/service-worker": "^18.2.12",
"@angular/platform-browser": "^18.2.13",
"@angular/platform-browser-dynamic": "^18.2.13",
"@angular/router": "^18.2.13",
"@angular/service-worker": "^18.2.13",
"@material/typography": "^14.0.0",
"@ngx-pwa/local-storage": "^18.0.0",
"@ngx-translate/core": "^16.0.3",
"@ngx-translate/http-loader": "^16.0.0",
"@tiptap/core": "^2.9.1",
"@tiptap/extension-color": "^2.9.1",
"@tiptap/extension-highlight": "^2.9.1",
"@tiptap/extension-image": "^2.9.1",
"@tiptap/extension-link": "^2.9.1",
"@tiptap/extension-subscript": "^2.9.1",
"@tiptap/extension-superscript": "^2.9.1",
"@tiptap/extension-table": "^2.9.1",
"@tiptap/extension-table-cell": "^2.9.1",
"@tiptap/extension-table-header": "^2.9.1",
"@tiptap/extension-table-row": "^2.9.1",
"@tiptap/extension-text-align": "^2.9.1",
"@tiptap/extension-text-style": "^2.9.1",
"@tiptap/extension-underline": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"@tiptap/starter-kit": "^2.9.1",
"@tiptap/core": "^2.10.3",
"@tiptap/extension-color": "^2.10.3",
"@tiptap/extension-highlight": "^2.10.3",
"@tiptap/extension-image": "^2.10.3",
"@tiptap/extension-link": "^2.10.3",
"@tiptap/extension-subscript": "^2.10.3",
"@tiptap/extension-superscript": "^2.10.3",
"@tiptap/extension-table": "^2.10.3",
"@tiptap/extension-table-cell": "^2.10.3",
"@tiptap/extension-table-header": "^2.10.3",
"@tiptap/extension-table-row": "^2.10.3",
"@tiptap/extension-text-align": "^2.10.3",
"@tiptap/extension-text-style": "^2.10.3",
"@tiptap/extension-underline": "^2.10.3",
"@tiptap/pm": "^2.10.3",
"@tiptap/starter-kit": "^2.10.3",
"@tsparticles/angular": "^3.0.0",
"@tsparticles/engine": "^3.5.0",
"@tsparticles/plugin-emitters": "^3.5.0",
"@tsparticles/shape-text": "^3.5.0",
"@tsparticles/slim": "^3.5.0",
"chart.js": "^4.4.6",
"@tsparticles/engine": "^3.7.1",
"@tsparticles/plugin-emitters": "^3.7.1",
"@tsparticles/shape-text": "^3.7.1",
"@tsparticles/slim": "^3.7.1",
"chart.js": "^4.4.7",
"cm-chess": "^3.5.1",
"cm-chessboard": "^8.7.4",
"date-fns": "^3.6.0",
Expand All @@ -82,7 +82,7 @@
"fzstd": "^0.1.1",
"jszip": "^3.10.1",
"material-design-icons-iconfont": "^6.7.0",
"ng2-charts": "^6.0.1",
"ng2-charts": "^7.0.0",
"ng2-pdf-viewer": "^10.3.4",
"ngx-cookie-service": "^18.0.0",
"ngx-date-fns": "^11.0.0",
Expand All @@ -96,23 +96,23 @@
"qrcode": "^1.5.4",
"rxjs": "^7.8.1",
"tinycolor2": "1.6.0",
"video.js": "^8.19.1",
"video.js": "^8.21.0",
"zone.js": "^0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.12",
"@angular-eslint/builder": "^18.4.0",
"@angular-eslint/eslint-plugin": "^18.4.0",
"@angular-eslint/eslint-plugin-template": "^18.4.0",
"@angular-eslint/schematics": "^18.4.0",
"@angular-eslint/template-parser": "^18.4.0",
"@angular-eslint/builder": "^18.4.3",
"@angular-eslint/eslint-plugin": "^18.4.3",
"@angular-eslint/eslint-plugin-template": "^18.4.3",
"@angular-eslint/schematics": "^18.4.3",
"@angular-eslint/template-parser": "^18.4.3",
"@angular/cli": "^18.2.12",
"@angular/compiler-cli": "^18.2.12",
"@angular/compiler-cli": "^18.2.13",
"@types/file-saver": "^2.0.7",
"@types/jasmine": "~5.1.4",
"@types/jasmine": "~5.1.5",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.17.6",
"@types/pdfmake": "^0.2.9",
"@types/node": "^20.17.9",
"@types/pdfmake": "^0.2.10",
"@types/qrcode": "^1.5.5",
"@types/tinycolor2": "^1.4.6",
"@types/video.js": "^7.3.58",
Expand All @@ -125,15 +125,15 @@
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "^4.1.4",
"fetch-mock": "^11.1.5",
"jasmine-core": "~5.4.0",
"jasmine-core": "~5.5.0",
"js-yaml": "^4.1.0",
"karma": "~6.4.4",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"npm-license-crawler": "^0.2.1",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"ts-dedent": "^2.2.0",
"ts-morph": "^24.0.0",
"ts-node": "^10.9.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export class ListOfSpeakers extends BaseModel<ListOfSpeakers> {
`id`,
`closed`,
`sequential_number`,
`moderator_notes`,
`content_object_id`,
`speaker_ids`,
`structure_level_list_of_speakers_ids`,
`projection_ids`,
`meeting_id`,
`moderator_notes`
`meeting_id`
];
}
export interface ListOfSpeakers extends HasMeetingId, HasProjectionIds, HasSequentialNumber {}
2 changes: 2 additions & 0 deletions client/src/app/domain/models/meetings/meeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export class Settings {
public motions_export_submitter_recommendation!: boolean;
public motions_export_follow_recommendation!: boolean;
public motions_hide_metadata_background: boolean;
public motions_create_enable_additional_submitter_text: boolean;

public motion_poll_ballot_paper_selection!: BallotPaperSelection;
public motion_poll_ballot_paper_number!: number;
Expand Down Expand Up @@ -375,6 +376,7 @@ export class Meeting extends BaseModel<Meeting> {
`motions_hide_metadata_background`,
`motions_show_referring_motions`,
`motions_show_sequential_number`,
`motions_create_enable_additional_submitter_text`,
`motions_recommendations_by`,
`motions_block_slide_columns`,
`motions_recommendation_text_mode`,
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/domain/models/motions/motion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class Motion extends BaseModel<Motion> implements MotionFormattingReprese
}

public amendment_paragraph_text(paragraphNumber: number): string | null {
return this.amendment_paragraphs && this.amendment_paragraphs[paragraphNumber]
return this.amendment_paragraphs && typeof this.amendment_paragraphs[paragraphNumber] === `string`
? this.amendment_paragraphs[paragraphNumber]
: null;
}
Expand Down
2 changes: 2 additions & 0 deletions client/src/app/domain/models/poll/poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class Poll extends BaseDecimalModel<Poll> {
public global_no!: boolean;
public global_abstain!: boolean;
public entitled_users_at_stop!: EntitledUsersEntry[];
public is_pseudoanonymized!: boolean;

public get isCreated(): boolean {
return this.state === PollState.Created;
Expand Down Expand Up @@ -154,6 +155,7 @@ export class Poll extends BaseDecimalModel<Poll> {
`title`,
`type`,
`backend`,
`is_pseudoanonymized`,
`pollmethod`,
`state`,
`min_votes_amount`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ export class PdfDocumentService {

// Add no heading text if there are logos on the right and left.
if (header && !(logoHeaderRightUrl && logoHeaderLeftUrl)) {
const name = this.translate.instant(this.meetingSettingsService.instant(`name`));
const description = this.translate.instant(this.meetingSettingsService.instant(`description`));
const name = this.meetingSettingsService.instant(`name`);
const description = this.meetingSettingsService.instant(`description`);
const location = this.meetingSettingsService.instant(`location`);
const start_time = this.meetingSettingsService.instant(`start_time`);
const end_time = this.meetingSettingsService.instant(`end_time`);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Injectable } from '@angular/core';
import { Id } from 'src/app/domain/definitions/key-types';

import { Presenter } from './presenter';
import { PresenterService } from './presenter.service';

interface GetUserEditablePresenterPayload {
user_ids: Id[];
fields: string[];
}

interface GetUserEditableIdentifiedScope {
[field: string]: [boolean, string?];
}

export interface GetUserEditablePresenterResult {
[user_id: Id]: GetUserEditableIdentifiedScope;
}

@Injectable({
providedIn: `root`
})
export class GetUserEditablePresenterService {
public constructor(private presenter: PresenterService) {}

public async call(payload: GetUserEditablePresenterPayload): Promise<GetUserEditablePresenterResult> {
return await this.presenter.call(Presenter.GET_USER_EDITABLE, payload);
}
}
1 change: 1 addition & 0 deletions client/src/app/gateways/presenter/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './get-active-users-amount-presenter.service';
export * from './get-forwarding-meetings-presenter.service';
export * from './get-user-editable-presenter.service';
export * from './get-user-related-models-presenter.service';
export * from './get-user-scope-presenter.service';
export * from './get-users-presenter.service';
Expand Down
1 change: 1 addition & 0 deletions client/src/app/gateways/presenter/presenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export enum Presenter {
SERVERTIME = `server_time`,
GET_USERS = `get_users`,
GET_ACTIVE_USER_AMOUNT = `get_active_users_amount`,
GET_USER_EDITABLE = `get_user_editable`,
GET_USER_RELATED_MODELS = `get_user_related_models`,
GET_USER_SCOPE = `get_user_scope`,
GET_FORWARDING_COMMITTEES = `get_forwarding_committees`,
Expand Down

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions client/src/app/gateways/repositories/base-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ export abstract class BaseRepository<V extends BaseViewModel, M extends BaseMode
this.tapViewModels(Object.values(this.viewModelStore));
if (changedModels) {
await this.initChangeBasedResorting(newModels, updatedModels, newViewModels, updatedViewModels);
for (const viewModel of updatedViewModels) {
viewModel.viewModelUpdateTimestamp = Date.now();
}
}
},
type: PipelineActionType.General,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export class MotionRepositoryService extends BaseAgendaItemAndListOfSpeakersCont
text: partialMotion.text,
origin_id: partialMotion.origin_id,
submitter_ids: partialMotion.submitter_ids,
additional_submitter: partialMotion.additional_submitter,
workflow_id: partialMotion.workflow_id,
category_id: partialMotion.category_id,
attachment_mediafile_ids:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export class PollRepositoryService extends BaseMeetingRelatedRepository<ViewPoll
`pollmethod`,
`onehundred_percent_base`,
`backend`,
`content_object_id`
`content_object_id`,
`is_pseudoanonymized`
];
return {
...super.getFieldsets(),
Expand Down
11 changes: 9 additions & 2 deletions client/src/app/infrastructure/utils/functions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,10 @@ describe(`utils: functions`, () => {
number: 1,
boolean: true
},
string: `string`
string: `string`,
empty_string: ``
};
const expected = `{\n "array": [\n "string1",\n "string2"\n ],\n "object": {\n "number": 1,\n "boolean": true\n },\n "string": "string"\n}`;
const expected = `{\n "array": [\n "string1",\n "string2"\n ],\n "object": {\n "number": 1,\n "boolean": true\n },\n "string": "string",\n "empty_string": ""\n}`;
it(`test with an object`, () => {
expect(objectToFormattedString(testObject)).toBe(expected);
});
Expand All @@ -533,6 +534,12 @@ describe(`utils: functions`, () => {
expect(objectToFormattedString(null)).toBe(undefined);
expect(objectToFormattedString(``)).toBe(undefined);
});

it(`test with object with empty string`, () => {
const obj1 = { string: `` };
const expected = `{\n "string": ""\n}`;
expect(objectToFormattedString(obj1)).toBe(expected);
});
});

describe(`isValidId function`, () => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/infrastructure/utils/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export function objectToFormattedString(jsonOrObject: string | object): string {
);

// Extract strings from JSON
const stringRegex = /\"([^\"]+)\"/g;
const stringRegex = /\"([^\"]*)\"/g;
const stringReplacement = `#`;
let strings: string[] = [...json.match(stringRegex)];
while (stringRegex.test(json)) {
Expand Down
Loading

0 comments on commit d545861

Please sign in to comment.