Skip to content

Commit

Permalink
Merge branch 'main' into 4332_login_button
Browse files Browse the repository at this point in the history
  • Loading branch information
Elblinator authored Nov 18, 2024
2 parents 82fb4b6 + 05b33aa commit 67e65c4
Show file tree
Hide file tree
Showing 28 changed files with 151 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
@if (projector!.show_clock) {
<os-projector-clock [color]="projector!.header_font_color"></os-projector-clock>
}
@for (slide of slides | async; track slide) {
@for (slide of slides | async; track slide.id) {
<div>
<os-slide-container
[projector]="projector!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
mergeMap,
Observable
} from 'rxjs';
import { UnsafeHtml } from 'src/app/domain/definitions/key-types';
import { Id, UnsafeHtml } from 'src/app/domain/definitions/key-types';
import { ViewProjector } from 'src/app/site/pages/meetings/pages/projectors';
import { MediaManageService } from 'src/app/site/pages/meetings/services/media-manage.service';
import { MeetingSettingsService } from 'src/app/site/pages/meetings/services/meeting-settings.service';
Expand Down Expand Up @@ -101,7 +101,9 @@ export class ProjectorComponent extends BaseUiComponent implements OnDestroy {
/**
* All slides to show on this projector
*/
public slides: Observable<SlideData<object>[]> = new Observable<SlideData<object>[]>();
public slides: Observable<(SlideData<object> & { id: Id })[]> = new Observable<
(SlideData<object> & { id: Id })[]
>();

/**
* Info about if the user is offline.
Expand Down Expand Up @@ -160,13 +162,14 @@ export class ProjectorComponent extends BaseUiComponent implements OnDestroy {
(projector?.current_projections || []).map(
projection =>
({
id: projection.id,
collection: projection.content?.collection,
data: projection.content,
stable: !!projection.stable,
type: projection.type || ``,
options: projection.options || {},
...(!!projection.content?.[`error`] && { error: projection.content[`error`] })
}) as SlideData
}) as SlideData & { id: Id }
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ export const listOfSpeakersSpeakerCountSubscription = {
follow: [
{
idField: `speaker_ids`,
fieldset: [`begin_time`, `end_time`],
follow: [
{
idField: `point_of_order_category_id`,
fieldset: FULL_FIELDSET
}
],
fieldset: [`begin_time`, `end_time`]
]
}
]
};
Expand All @@ -151,11 +151,11 @@ export const getListOfSpeakersDetailSubscriptionConfig: SubscriptionConfigGenera
follow: [
{
idField: `meeting_user_id`,
fieldset: [`number`, `vote_weight`],
follow: [
{ idField: `user_id`, ...UserFieldsets.FullNameSubscription },
{ idField: `structure_level_ids`, fieldset: [`name`] }
],
fieldset: [`number`, `vote_weight`]
]
},
{
idField: `structure_level_list_of_speakers_id`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const getMediafilesListMinimalSubscriptionConfig: SubscriptionConfigGener
modelRequest: {
viewModelCtor: ViewMeeting,
ids: [id],
follow: [`mediafile_ids`, `meeting_mediafile_ids`]
follow: [{ idField: `mediafile_ids` }, { idField: `meeting_mediafile_ids` }]
},
subscriptionName: MEDIAFILES_LIST_MINIMAL_SUBSCRIPTION
});
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@
<div>
<mat-checkbox formControlName="value">{{ setting.label | translate }}</mat-checkbox>
@if (setting.helpText) {
<mat-hint class="hint-checkbox">{{ setting.helpText | translate }}</mat-hint>
<mat-hint class="hint-checkbox settings-form-group">
{{ setting.helpText | translate }}
</mat-hint>
}
@if (getWarning()) {
<mat-hint class="hint-checkbox red-warning-text">
{{ setting.warnText | translate }}
</mat-hint>
}
@if (error) {
<div class="error">{{ error }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ export class MeetingSettingsGroupDetailFieldComponent extends BaseComponent impl
this.cd.detach();
}

/**
* Checks if a warning should be given
*
*/
public getWarning(): boolean {
if (this.setting.warn) {
return this.setting.warn(this.orgaSettings);
} else {
return false;
}
}

public getRestrictedValue<T>(value: T): T {
if (this.setting.restrictionFn) {
return this.setting.restrictionFn(this.orgaSettings, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ export const getMotionWorkflowDetailSubscriptionConfig: SubscriptionConfigGenera
modelRequest: {
ids: [id],
viewModelCtor: ViewMotionWorkflow,
fieldset: [],
follow: [
{
idField: `state_ids`
}
],
fieldset: ``
]
},
subscriptionName: MOTION_WORKFLOW_DETAIL_SUBSCRIPTION
});
Expand Down Expand Up @@ -189,13 +189,13 @@ export const getMotionDetailSubscriptionConfig: SubscriptionConfigGenerator = (.
{ idField: `comment_ids`, fieldset: FULL_FIELDSET },
{
idField: `supporter_meeting_user_ids`,
fieldset: `participantListMinimal`,
follow: [
{
idField: `user_id`,
fieldset: `participantList`
}
],
fieldset: `participantListMinimal`
]
}
],
fieldset: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<div class="motion-content">
<!-- Reason -->
@if (motion.reason) {
@if (showReason) {
<div>
<h3>{{ 'Reason' | translate }}</h3>
<div class="motion-text underlined-links" [innerHtml]="motion.reason | trust: 'html'"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export class MotionContentComponent extends BaseMotionDetailChildComponent {
return this.motion.showPreamble;
}

public get showReason(): boolean {
return !!this.motion.reason?.replace(/<p>/, ``).replace(/<\/p>/, ``).trim();
}

public get canChangeMetadata(): boolean {
return this.perms.isAllowed(`change_metadata`, this.motion);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class="primary-accent-by-theme"
mat-icon-button
matTooltipPosition="right"
[hidden]="publicAccess"
matTooltip="{{ 'Mark as personal favorite' | translate }}"
(click)="setFavorite(!isFavorite)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class MotionManageTitleComponent extends BaseMotionDetailChildComponent {
return this._changeRecoMode;
}

@Input()
public publicAccess: boolean;

@Output()
public updateCrMode = new EventEmitter<ChangeRecoMode>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ <h2>
<os-motion-manage-title
[changeRecoMode]="changeRecoMode"
[motion]="motion"
[publicAccess]="operator.isAnonymous"
(updateCrMode)="changeRecoMode = $event"
></os-motion-manage-title>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ <h4>{{ 'Voting right delegated to (proxy)' | translate }}</h4>
@if (showVoteDelegations && user!.vote_delegations_from().length > 0) {
<div>
<h4>
{{ 'Voting right received from ' | translate }}{{ user!.vote_delegations_from().length
}}{{ ' principals' | translate }}
{{ 'Principals' | translate }}
</h4>
<os-expandable-content-wrapper
[biggerHeight]="true"
Expand Down Expand Up @@ -335,10 +334,10 @@ <h4>{{ 'Comment' | translate }}</h4>
<!-- Locked out? -->
@if (isAllowed('seeSensitiveData')) {
<mat-icon class="margin-4" [class.red-warning-text]="user!.isLockedOutOfMeeting()">
{{ user!.isLockedOutOfMeeting() ? 'visibility_off' : 'check_box_outline_blank' }}
{{ user!.isLockedOutOfMeeting() ? 'visibility_off' : '' }}
</mat-icon>
<span>
{{ (user?.isLockedOutOfMeeting() ? 'Is locked out' : 'Is not locked out') | translate }}
{{ (user?.isLockedOutOfMeeting() ? 'Is locked out' : '') | translate }}
</span>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2>{{ 'Participants' | translate }}</h2>
@if (isInPolldefaultGroup(user)) {
{{ 'Vote weight' | translate }}: {{ user.vote_weight() }}
@if (user.hasVoteRightFromOthers()) {
+ {{ sumOfDelegatedVoteWeight(user) }} {{ ' from delegated votes' | translate }}
+ {{ sumOfDelegatedVoteWeight(user) }} {{ 'from delegated votes' | translate }}
}
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export const getParticipantVoteInfoSubscriptionConfig: SubscriptionConfigGenerat
},
{
idField: `vote_delegated_to_id`,
follow: [{ idField: `user_id`, fieldset: [`is_present_in_meeting_ids`] }],
fieldset: [`meeting_id`]
fieldset: [`meeting_id`],
follow: [{ idField: `user_id`, fieldset: [`is_present_in_meeting_ids`] }]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const getProjectorListSubscriptionConfig: SubscriptionConfigGenerator = (
modelRequest: {
viewModelCtor: ViewMeeting,
ids: [id],
additionalFields: [`reference_projector_id`],
follow: [
{
idField: `projector_ids`,
Expand Down Expand Up @@ -61,14 +62,13 @@ export const getProjectorListSubscriptionConfig: SubscriptionConfigGenerator = (
}
]
},
`projector_countdown_ids`,
`projector_message_ids`,
...MEETING_DEFAULT_PROJECTOR_IDS_KEYS,
{ idField: `projector_countdown_ids` },
{ idField: `projector_message_ids` },
{ idField: `speaker_ids`, additionalFields: [`meeting_user_id`] },
`list_of_speakers_ids`,
{ idField: `agenda_item_ids`, fieldset: [`item_number`, `content_object_id`] }
],
additionalFields: [`reference_projector_id`]
{ idField: `list_of_speakers_ids` },
{ idField: `agenda_item_ids`, fieldset: [`item_number`, `content_object_id`] },
...MEETING_DEFAULT_PROJECTOR_IDS_KEYS
]
},
subscriptionName: PROJECTOR_LIST_SUBSCRIPTION
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ export function getActiveMeetingSubscriptionConfig(id: Id, settingsKeys: string[
}, // TODO: Remove and count unread messages by chat_group_ids/chat_message_ids
{
idField: `poll_ids`,
fieldset: [`title`, `state`, `entitled_group_ids`],
follow: [
{
idField: `content_object_id`,
fieldset: [`title`],
follow: [{ idField: `agenda_item_id`, fieldset: [`item_number`, `content_object_id`] }]
}
],
fieldset: [`title`, `state`, `entitled_group_ids`]
]
},
{
idField: `point_of_order_category_ids`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface SettingsInput<V = any> {
// alternative to `choices`; overwrites `choices` if both are given
choicesFunc?: ChoicesFunctionDefinition<V>;
helpText?: string; // default: ""
warnText?: string; // default: ""
indentation?: number; // default: 0. Indents the input field by the given amount to simulate nested settings
validators?: ValidatorFn[]; // default: []
automaticChangesSetting?: SettingsItemAutomaticChangeSetting<V>;
Expand Down Expand Up @@ -88,6 +89,13 @@ export interface SettingsInput<V = any> {
* @returns whether to disable the setting or not
*/
forbidden?: (meetingView: ViewMeeting) => boolean;
/**
* A function to conditionally give a warning depending on used organization's settings
*
* @param orgaSettings: The `OrganizationSettingsService` has to be passed, because it is not injected in the
* settings definitions
*/
warn?: (orgaSettings: OrganizationSettingsService) => boolean;

hide?: boolean; // Hide the setting in the settings view
}
Expand Down Expand Up @@ -207,7 +215,11 @@ export const meetingSettings: SettingsGroup[] = fillInSettingsDefaults([
type: `boolean`,
helpText: _(
`Enables public access to this meeting without login data. Permissions can be set after activation in the new group 'Public'.`
)
),
warnText: _(
`The public access setting is deactivated for the organization. Please contact your admins or hosting providers to activate the setting.`
),
warn: orgaSettings => !orgaSettings.instant(`enable_anonymous`)
}
]
},
Expand Down Expand Up @@ -1006,14 +1018,16 @@ export const meetingSettings: SettingsGroup[] = fillInSettingsDefaults([
{
key: `users_email_subject`,
label: _(`Email subject`),
helpText: _(`You can use {event_name} and {username} as placeholder.`)
helpText: _(
`Possible placeholders for email subject and body: {title}, {first_name}, {last_name}, {groups}, {structure_levels}, {event_name}, {url}, {username} and {password}`
)
},
{
key: `users_email_body`,
label: _(`Email body`),
type: `text`,
helpText: _(
`Use these placeholders: {name}, {event_name}, {url}, {username}, {password}. The url referrs to the system url.`
`Possible placeholders for email subject and body: {title}, {first_name}, {last_name}, {groups}, {structure_levels}, {event_name}, {url}, {username} and {password}`
)
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function getMeetingListFollowConfig(
): any {
return {
idField: idField,
fieldset: `list`,
follow: [
{ idField: `committee_id`, fieldset: `name` },
{ idField: `organization_tag_ids`, fieldset: FULL_FIELDSET }
],
fieldset: `list`
]
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const getAccountDetailSubscriptionConfig: SubscriptionConfigGenerator = (
{ idField: `committee_ids`, fieldset: [`name`, `manager_ids`] },
{
idField: `meeting_ids`,
follow: [{ idField: `group_ids`, fieldset: [`name`], isFullList: false }],
fieldset: [`name`, `committee_id`]
fieldset: [`name`, `committee_id`],
follow: [{ idField: `group_ids`, fieldset: [`name`], isFullList: false }]
},
{ idField: `gender_id`, fieldset: [`name`] }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export const getOrganizationTagListSubscriptionConfig: SubscriptionConfigGenerat
modelRequest: {
viewModelCtor: ViewOrganization,
ids: [ORGANIZATION_ID],
follow: [`organization_tag_ids`]
follow: [{ idField: `organization_tag_ids` }]
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h2>{{ 'Superadmin settings' | translate }}</h2>

<section>
<mat-checkbox formControlName="enable_anonymous">
{{ 'Meetings can be public' | translate }}
{{ 'Enable public meetings' | translate }}
</mat-checkbox>
</section>

Expand Down
2 changes: 1 addition & 1 deletion client/src/app/site/services/auth-check.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class AuthCheckService {
if (typeof info === `string`) {
meetingIdString = this.osRouter.getMeetingId(info);
}
if (Number.isNaN(Number(meetingIdString))) {
if (Number.isNaN(Number(meetingIdString)) || +meetingIdString <= 0) {
return false;
}
await this.fetchMeetingIfNotExists(+meetingIdString);
Expand Down
Loading

0 comments on commit 67e65c4

Please sign in to comment.