From 67f3d5ea4e96e711ebc871ad5f88a4b15dfc8290 Mon Sep 17 00:00:00 2001 From: anbebe Date: Wed, 13 Nov 2024 16:24:45 +0100 Subject: [PATCH 1/3] Add warning text in meeting settings if organisation has not enabled public access --- ...eeting-settings-group-detail-field.component.html | 5 ++++- .../meeting-settings-group-detail-field.component.ts | 12 ++++++++++++ .../meeting-settings-definitions.ts | 12 +++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html index 34cee03cea..dc1eb71fb6 100644 --- a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html +++ b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html @@ -95,7 +95,10 @@
{{ setting.label | translate }} @if (setting.helpText) { - {{ setting.helpText | translate }} + {{ setting.helpText | translate }} + } + @if (getWarning()) { + {{ setting.warnText | translate }} } @if (error) {
{{ error }}
diff --git a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts index 79b76f94be..8da06e487c 100644 --- a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts +++ b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts @@ -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(value: T): T { if (this.setting.restrictionFn) { return this.setting.restrictionFn(this.orgaSettings, value); diff --git a/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts b/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts index b19ee5ef25..b2a9348670 100644 --- a/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts +++ b/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts @@ -60,6 +60,7 @@ export interface SettingsInput { // alternative to `choices`; overwrites `choices` if both are given choicesFunc?: ChoicesFunctionDefinition; 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; @@ -88,6 +89,13 @@ export interface SettingsInput { * @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 } @@ -207,7 +215,9 @@ 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 this meeting.'), + warn: orgaSettings => !orgaSettings.instant(`enable_anonymous`) } ] }, From b6f29fcb790bb81486f531f66d525debae4730f9 Mon Sep 17 00:00:00 2001 From: anbebe Date: Wed, 13 Nov 2024 16:45:21 +0100 Subject: [PATCH 2/3] fixed code style, run npm cleanup --- .../meeting-settings-group-detail-field.component.html | 8 ++++++-- .../meeting-settings-group-detail-field.component.ts | 4 ++-- .../meeting-settings-definitions.ts | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html index dc1eb71fb6..19f56cb608 100644 --- a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html +++ b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.html @@ -95,10 +95,14 @@
{{ setting.label | translate }} @if (setting.helpText) { - {{ setting.helpText | translate }} + + {{ setting.helpText | translate }} + } @if (getWarning()) { - {{ setting.warnText | translate }} + + {{ setting.warnText | translate }} + } @if (error) {
{{ error }}
diff --git a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts index 8da06e487c..7c3d0b6772 100644 --- a/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts +++ b/client/src/app/site/pages/meetings/pages/meeting-settings/pages/meeting-settings-group-detail/components/meeting-settings-group-detail-field/meeting-settings-group-detail-field.component.ts @@ -276,10 +276,10 @@ export class MeetingSettingsGroupDetailFieldComponent extends BaseComponent impl /** * Checks if a warning should be given - * + * */ public getWarning(): boolean { - if (this.setting.warn){ + if (this.setting.warn) { return this.setting.warn(this.orgaSettings); } else { return false; diff --git a/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts b/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts index b2a9348670..bd1b69e584 100644 --- a/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts +++ b/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts @@ -216,7 +216,7 @@ export const meetingSettings: SettingsGroup[] = fillInSettingsDefaults([ 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 this meeting.'), + warnText: _(`The public access setting is deactivated for this meeting.`), warn: orgaSettings => !orgaSettings.instant(`enable_anonymous`) } ] From ca06eaa944e4030b4e02912a1e623500977f6886 Mon Sep 17 00:00:00 2001 From: anbebe Date: Fri, 15 Nov 2024 16:44:14 +0100 Subject: [PATCH 3/3] Change wording of warn text --- .../meeting-settings-definitions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts b/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts index bd1b69e584..1e283c3060 100644 --- a/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts +++ b/client/src/app/site/pages/meetings/services/meeting-settings-definition.service/meeting-settings-definitions.ts @@ -216,7 +216,9 @@ export const meetingSettings: SettingsGroup[] = fillInSettingsDefaults([ 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 this meeting.`), + 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`) } ]