Skip to content

Commit

Permalink
Merge branch 'main' into feature/motion-forward
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianjoel committed Sep 30, 2024
2 parents d35d56a + ea93051 commit a72366f
Show file tree
Hide file tree
Showing 94 changed files with 1,762 additions and 693 deletions.
952 changes: 484 additions & 468 deletions client/package-lock.json

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,38 +36,38 @@
"get-available-languages": "npm run ts -- cli/get-available-languages.ts"
},
"dependencies": {
"@angular/animations": "^18.2.3",
"@angular/cdk": "^18.2.3",
"@angular/common": "^18.2.3",
"@angular/compiler": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/forms": "^18.2.3",
"@angular/material": "^18.2.3",
"@angular/material-date-fns-adapter": "^18.2.3",
"@angular/platform-browser": "^18.2.3",
"@angular/platform-browser-dynamic": "^18.2.3",
"@angular/router": "^18.2.3",
"@angular/service-worker": "^18.2.3",
"@angular/animations": "^18.2.5",
"@angular/cdk": "^18.2.5",
"@angular/common": "^18.2.5",
"@angular/compiler": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/forms": "^18.2.5",
"@angular/material": "^18.2.5",
"@angular/material-date-fns-adapter": "^18.2.5",
"@angular/platform-browser": "^18.2.5",
"@angular/platform-browser-dynamic": "^18.2.5",
"@angular/router": "^18.2.5",
"@angular/service-worker": "^18.2.5",
"@material/typography": "^14.0.0",
"@ngx-pwa/local-storage": "^18.0.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@tiptap/core": "^2.6.6",
"@tiptap/extension-color": "^2.6.6",
"@tiptap/extension-highlight": "^2.6.6",
"@tiptap/extension-image": "^2.6.6",
"@tiptap/extension-link": "^2.6.6",
"@tiptap/extension-subscript": "^2.6.6",
"@tiptap/extension-superscript": "^2.6.6",
"@tiptap/extension-table": "^2.6.6",
"@tiptap/extension-table-cell": "^2.6.6",
"@tiptap/extension-table-header": "^2.6.6",
"@tiptap/extension-table-row": "^2.6.6",
"@tiptap/extension-text-align": "^2.6.6",
"@tiptap/core": "^2.7.2",
"@tiptap/extension-color": "^2.7.2",
"@tiptap/extension-highlight": "^2.7.2",
"@tiptap/extension-image": "^2.7.2",
"@tiptap/extension-link": "^2.7.2",
"@tiptap/extension-subscript": "^2.7.2",
"@tiptap/extension-superscript": "^2.7.2",
"@tiptap/extension-table": "^2.7.2",
"@tiptap/extension-table-cell": "^2.7.2",
"@tiptap/extension-table-header": "^2.7.2",
"@tiptap/extension-table-row": "^2.7.2",
"@tiptap/extension-text-align": "^2.7.2",
"@tiptap/extension-text-style": "^2.5.4",
"@tiptap/extension-underline": "^2.6.6",
"@tiptap/extension-underline": "^2.7.2",
"@tiptap/pm": "^2.5.4",
"@tiptap/starter-kit": "^2.6.6",
"@tiptap/starter-kit": "^2.7.2",
"@tsparticles/angular": "^3.0.0",
"@tsparticles/engine": "^3.5.0",
"@tsparticles/plugin-emitters": "^3.5.0",
Expand All @@ -83,7 +83,7 @@
"jszip": "^3.10.1",
"material-design-icons-iconfont": "^6.7.0",
"ng2-charts": "^6.0.1",
"ng2-pdf-viewer": "^10.3.0",
"ng2-pdf-viewer": "^10.3.1",
"ngx-date-fns": "^11.0.0",
"ngx-device-detector": "^8.0.0",
"ngx-file-drop": "^16.0.0",
Expand All @@ -95,18 +95,18 @@
"qrcode": "^1.5.4",
"rxjs": "^7.8.1",
"tinycolor2": "1.6.0",
"video.js": "^8.17.3",
"video.js": "^8.17.4",
"zone.js": "^0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.3",
"@angular-eslint/builder": "^18.3.0",
"@angular-eslint/eslint-plugin": "^18.3.0",
"@angular-eslint/eslint-plugin-template": "^18.3.0",
"@angular-eslint/schematics": "^18.3.0",
"@angular-eslint/template-parser": "^18.3.0",
"@angular/cli": "^18.2.3",
"@angular/compiler-cli": "^18.2.3",
"@angular-devkit/build-angular": "^18.2.5",
"@angular-eslint/builder": "^18.3.1",
"@angular-eslint/eslint-plugin": "^18.3.1",
"@angular-eslint/eslint-plugin-template": "^18.3.1",
"@angular-eslint/schematics": "^18.3.1",
"@angular-eslint/template-parser": "^18.3.1",
"@angular/cli": "^18.2.5",
"@angular/compiler-cli": "^18.2.5",
"@colsen1991/ngx-translate-extract-marker": "^2.0.8",
"@types/file-saver": "^2.0.7",
"@types/jasmine": "~5.1.4",
Expand All @@ -119,12 +119,12 @@
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vendure/ngx-translate-extract": "^9.2.1",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "^4.1.3",
"fetch-mock": "^11.1.3",
"eslint-plugin-unused-imports": "^4.1.4",
"fetch-mock": "^11.1.4",
"jasmine-core": "~5.3.0",
"js-yaml": "^4.1.0",
"karma": "~6.4.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const meetingSettingsDefaults: { [key: string]: any } = {
motions_supporters_min_amount: 0,
motions_block_slide_columns: 3,
motion_poll_default_type: `pseudoanonymous`,
motion_poll_default_method: `YNA`,
motion_poll_default_onehundred_percent_base: `YNA`,
motion_poll_ballot_paper_selection: `CUSTOM_NUMBER`,
motion_poll_ballot_paper_number: 8,
Expand Down
4 changes: 3 additions & 1 deletion client/src/app/domain/definitions/permission.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ Meeting specific information: Structure level, Group, Participant number, About
},
{
display_name: _(`Can see sensitive data`),
help_text: _(`Can see email, username and SSO identification of all participants.`),
help_text: _(
`Can see email, username, membership number, SSO identification and locked out state of all participants.`
),
value: Permission.userCanSeeSensitiveData
},
{
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/domain/fieldsets/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BaseSimplifiedModelRequest } from 'src/app/site/services/model-request-

export class UserFieldsets {
public static readonly FullNameSubscription: BaseSimplifiedModelRequest = {
fieldset: [`title`, `first_name`, `last_name`, `pronoun`, `username`, `gender`, `default_vote_weight`]
fieldset: [`title`, `first_name`, `last_name`, `pronoun`, `username`, `default_vote_weight`, `gender_id`]
};
}

Expand Down
21 changes: 21 additions & 0 deletions client/src/app/domain/models/gender/gender.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Id } from '../../definitions/key-types';
import { BaseModel } from '../base/base-model';
/**
* Representation of a gender.
* @ignore
*/

export class Gender extends BaseModel<Gender> {
public static COLLECTION = `gender`;

public readonly name!: string;
public organization_id!: Id; // (organization/gender_ids)[]
public user_ids!: Id[]; // user/gender_id

public constructor(input?: Partial<Gender>) {
super(Gender.COLLECTION, input);
}

public static readonly REQUESTABLE_FIELDS: (keyof Gender)[] = [`id`, `name`, `organization_id`, `user_ids`];
}
export interface Gender {}
2 changes: 2 additions & 0 deletions client/src/app/domain/models/meeting-users/meeting-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class MeetingUser extends BaseDecimalModel<MeetingUser> {
public readonly number!: string;
public readonly about_me!: string;
public readonly vote_weight!: number;
public readonly locked_out!: boolean;

public user_id!: Id;
public meeting_id!: Id;
Expand Down Expand Up @@ -42,6 +43,7 @@ export class MeetingUser extends BaseDecimalModel<MeetingUser> {
`number`,
`about_me`,
`vote_weight`,
`locked_out`,
`user_id`,
`meeting_id`,
`personal_note_ids`,
Expand Down
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 @@ -146,6 +146,7 @@ export class Settings {
public motion_poll_default_onehundred_percent_base!: PollPercentBase;
public motion_poll_default_group_ids!: Id[]; // (group/used_as_motion_poll_default_id)[];
public motion_poll_default_backend!: PollBackendDurationType;
public motion_poll_default_method!: PollMethod;

// Users
public users_enable_presence_view!: boolean;
Expand Down Expand Up @@ -394,6 +395,7 @@ export class Meeting extends BaseModel<Meeting> {
`motion_poll_ballot_paper_selection`,
`motion_poll_ballot_paper_number`,
`motion_poll_default_type`,
`motion_poll_default_method`,
`motion_poll_default_onehundred_percent_base`,
`motion_poll_default_group_ids`,
`motion_poll_default_backend`,
Expand Down
4 changes: 2 additions & 2 deletions client/src/app/domain/models/organizations/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class OrganizationSetting {
public saml_metadata_idp!: string;
public saml_metadata_sp!: string;
public saml_private_key!: string;
public genders!: string[];
}

export class Organization extends BaseModel<Organization> {
Expand All @@ -52,6 +51,7 @@ export class Organization extends BaseModel<Organization> {
public archived_meeting_ids!: Id[]; // (meeting/is_archived_in_organization_id)[];
public template_meeting_ids!: Id[]; // (meeting/template_for_organization_id)[];
public mediafile_ids!: Id[];
public gender_ids!: Id[]; // (gender/organization_id);
public published_mediafile_ids!: Id[];

public constructor(input?: any) {
Expand All @@ -66,7 +66,7 @@ export class Organization extends BaseModel<Organization> {
`privacy_policy`,
`login_text`,
`reset_password_verbose_errors`,
`genders`,
`gender_ids`,
`enable_electronic_voting`,
`enable_chat`,
`limit_of_meetings`,
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/domain/models/users/user.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { marker as _ } from '@colsen1991/ngx-translate-extract-marker';

import { User } from './user';

export const userHeadersAndVerboseNames: { [key in keyof User]?: any } = {
export const userHeadersAndVerboseNames: { [key in keyof User | 'gender']?: any } = {
title: _(`Title`),
first_name: _(`Given name`),
last_name: _(`Surname`),
Expand Down
4 changes: 2 additions & 2 deletions client/src/app/domain/models/users/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class User extends BaseDecimalModel<User> {
public readonly is_physical_person!: boolean;
public readonly default_password!: string;
public readonly can_change_own_password!: boolean;
public readonly gender!: string;
public readonly email!: string;
public readonly last_email_sent!: number; // comes in seconds
public readonly last_login!: number; // comes in seconds
Expand All @@ -52,6 +51,7 @@ export class User extends BaseDecimalModel<User> {

public organization_management_level!: keyof OMLMapping;
public committee_management_ids!: Id[];
public gender_id: Id; // (gender/user_ids)[]

public constructor(input?: Partial<User>) {
super(User.COLLECTION, input);
Expand All @@ -74,12 +74,12 @@ export class User extends BaseDecimalModel<User> {
`is_physical_person`,
`default_password`,
`can_change_own_password`,
`gender`,
`email`,
`default_vote_weight`,
`last_email_sent`,
`is_demo_user`,
`last_login`,
`gender_id`,
`organization_management_level`,
`is_present_in_meeting_ids`,
`committee_ids`,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';

import { GenderRepositoryService } from './gender-repository.service';

xdescribe(`GenderRepositoryService`, () => {
let service: GenderRepositoryService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(GenderRepositoryService);
});

it(`should be created`, () => {
expect(service).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Injectable } from '@angular/core';
import { Id } from 'src/app/domain/definitions/key-types';
import { Identifiable } from 'src/app/domain/interfaces';
import { Gender } from 'src/app/domain/models/gender/gender';
import { BaseRepository } from 'src/app/gateways/repositories/base-repository';
import { ViewGender } from 'src/app/site/pages/organization/pages/accounts/pages/gender/view-models/view-gender';
import { Fieldsets } from 'src/app/site/services/model-request-builder';

import { Action } from '../../actions';
import { RepositoryServiceCollectorService } from '../repository-service-collector.service';
import { GenderAction } from './gender.action';

@Injectable({
providedIn: `root`
})
export class GenderRepositoryService extends BaseRepository<ViewGender, Gender> {
public constructor(repositoryServiceCollector: RepositoryServiceCollectorService) {
super(repositoryServiceCollector, Gender);
}

public getVerboseName = (plural?: boolean): string => (plural ? `Genders` : `Gender`);
public getTitle = (viewModel: ViewGender): string => viewModel.name;
public override getFieldsets(): Fieldsets<any> {
const baseFields: (keyof Gender)[] = [];
const requiredFields: (keyof Gender)[] = baseFields.concat([`name`]);
return {
...super.getFieldsets(),
required: requiredFields
};
}

public create(...genders: any[]): Action<Identifiable[]> {
const payload = genders;
return this.createAction(GenderAction.CREATE, payload);
}

public update(update: any, id: Id): Action<void> {
const payload = {
id,
...update
};
return this.createAction(GenderAction.UPDATE, payload);
}

public delete(...ids: Id[]): Action<void> {
const payload = ids.map(id => ({ id }));
return this.createAction(GenderAction.DELETE, payload);
}
}
5 changes: 5 additions & 0 deletions client/src/app/gateways/repositories/gender/gender.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export class GenderAction {
public static readonly CREATE = `gender.create`;
public static readonly UPDATE = `gender.update`;
public static readonly DELETE = `gender.delete`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export class MeetingUserRepositoryService extends BaseMeetingRelatedRepository<V
`vote_weight`,
`comment`,
`user_id`,
`number`
`number`,
`locked_out`
]);

const detailFields: TypedFieldset<MeetingUser> = [`about_me`, `user_id`, `meeting_id`];
Expand All @@ -57,7 +58,8 @@ export class MeetingUserRepositoryService extends BaseMeetingRelatedRepository<V
vote_delegated_to_id: partialUser.vote_delegated_to_id,
vote_delegations_from_ids: partialUser.vote_delegations_from_ids,
structure_level_ids: partialUser.structure_level_ids,
group_ids: partialUser.group_ids
group_ids: partialUser.group_ids,
locked_out: partialUser.locked_out
};

if (Object.values(partialPayload).filter(val => val !== undefined).length > 1 && partialPayload.meeting_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export class OrganizationRepositoryService extends BaseRepository<ViewOrganizati
`default_language`,
`saml_metadata_idp`,
`saml_metadata_sp`,
`saml_private_key`,
`genders`
`saml_private_key`
);
return {
...super.getFieldsets(),
Expand Down
Loading

0 comments on commit a72366f

Please sign in to comment.