Skip to content

Commit

Permalink
Merge branch 'master' into fixes-to-LinksForm.jsx-component
Browse files Browse the repository at this point in the history
  • Loading branch information
nirajkumar999 authored Aug 1, 2024
2 parents 3b3c9ee + 3f025cc commit affe1cf
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 24 deletions.
16 changes: 13 additions & 3 deletions app/assets/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@
"wrong_access_code": "Λάθος κωδικός πρόσβασης",
"generate_viewers_access_code": "Δημιουργία κωδικού πρόσβασης για θεατές",
"generate_mods_access_code": "Δημιουργία κωδικού πρόσβασης για συντονιστές",
"server_tag": "Επιλέξτε ένα τύπο διακομιστή για αυτή την αίθουσα",
"default_tag_name": "Προεπιλογή",
"server_tag_desired": "Επιθυμητό",
"server_tag_required": "Απαιτείται",
"are_you_sure_delete_room": "Θέλετε σίγουρα να διαγράψετε αυτή την αίθουσα;"
}
},
Expand Down Expand Up @@ -274,7 +278,7 @@
"administration": {
"administration": "Διαχείριση",
"terms": "Όροι και Προϋποθέσεις",
"privacy": "Πολιτική απορρήτου",
"privacy": "Πολιτική Απορρήτου",
"privacy_policy": "Πολιτική Απορρήτου",
"change_term_links": "Αλλαγή των συνδέσμων για τους όρους χρήσης που εμφανίζονται στο κάτω μέρος της σελίδας",
"change_privacy_link": "Αλλαγή του συνδέσμου για το απόρρητο που εμφανίζεται στο κάτω μέρος της σελίδας",
Expand Down Expand Up @@ -303,7 +307,7 @@
"registration": {
"registration": "Εγγραφή",
"role_mapping_by_email": "Εκχώρηση ρόλου με email",
"role_mapping_by_email_description": "Εκχώρηση ρόλου σε χρήστη με χρήση του email του. Πρέπει να είναι όπως: role1=email1, role2=email2",
"role_mapping_by_email_description": "Κατανείμετε το ρόλο χρήστη σύμφωνα με το email. Πρέπει να έχει τη μορφή role1=email1,role2=email2",
"enter_role_mapping_rule": "Εισαγάγετε ένα κανόνα εκχώρησης ρόλου",
"resync_on_login": "Συγχρονισμός δεδομένων χρήστη σε κάθε σύνδεση",
"resync_on_login_description": "Επανασυγχρονισμός των πληροφοριών χρήστη σε κάθε σύνδεση, υποχρεώνοντας τον εξωτερικό πάροχο αυθεντικοποίησης σε συνεχή επιβεβαίωση των πληροφοριών στο Greenlight",
Expand Down Expand Up @@ -413,7 +417,7 @@
"brand_color_updated": "Το χρώμα επωνυμίας ενημερώθηκε.",
"brand_image_updated": "Η εικόνα επωνυμίας ενημερώθηκε.",
"brand_image_deleted": "Η εικόνα επωνυμίας διαγράφηκε.",
"privacy_policy_updated": "Η πολιτική ιδιωτικότητας ενημερώθηκε.",
"privacy_policy_updated": "Η πολιτική απορρήτου ενημερώθηκε.",
"helpcenter_updated": "Ο σύνδεσμος για το Κέντρο βοήθειας ενημερώθηκε. ",
"terms_of_service_updated": "Οι όριο χρήσης ενημερώθηκαν.",
"maintenance_updated": "Το μήνυμα της λειτουργίας συντήρησης ενημερώθηκε."
Expand All @@ -437,6 +441,7 @@
},
"error": {
"problem_completing_action": "Παρουσιάστηκε πρόβλημα σε αυτή την ενέργεια.\nΠαρακαλούμε δοκιμάστε ξανά.",
"server_type_unavailable": "Ο επιθυμητός τύπος διακομιστή δεν είναι διαθέσιμος. Παρακαλούμε επιλέξτε διαφορετικό τύπο από τις ρυθμίσεις αίθουσας. ",
"file_type_not_supported": "Ο τύπος αρχείου δεν υποστηρίζεται.",
"file_size_too_large": "Το μέγεθος αρχείου είναι πολύ μεγάλο.",
"file_upload_error": "Το αρχείο δεν μπορεί να μεταφορτωθεί.",
Expand Down Expand Up @@ -533,6 +538,11 @@
},
"url": {
"invalid": "Μη έγκυρο URL"
},
"text_form": {
"value": {
"required": "Παρακαλούμε πληκτρολογήστε το μήνυμά σας"
}
}
},
"room": {
Expand Down
7 changes: 6 additions & 1 deletion app/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
"registration": {
"registration": "Registration",
"role_mapping_by_email": "Role Mapping By Email",
"role_mapping_by_email_description": "Map the user to a role using their email. Must be in the format: role1=email1, role2=email2",
"role_mapping_by_email_description": "Map the user to a role using their email. Must be in the format: role1=email1,role2=email2",
"enter_role_mapping_rule": "Enter a role mapping rule",
"resync_on_login": "Resync User Data On Every Sign In",
"resync_on_login_description": "Resync a user's information every time they sign in, making the external authentication provider always match the information in Greenlight",
Expand Down Expand Up @@ -538,6 +538,11 @@
},
"url": {
"invalid": "Invalid URL"
},
"text_form": {
"value": {
"required": "Please enter some message"
}
}
},
"room": {
Expand Down
16 changes: 13 additions & 3 deletions app/assets/locales/fa_IR.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@
"wrong_access_code": "کد دسترسی اشتباه است",
"generate_viewers_access_code": "ایجاد کد دسترسی برای بینندگان",
"generate_mods_access_code": "ایجاد کد دسترسی برای مدیران",
"server_tag": "نوع سرور برای این اتاق انتخاب کنید",
"default_tag_name": "پیش‌فرض",
"server_tag_desired": "دلخواه",
"server_tag_required": "الزامی است",
"are_you_sure_delete_room": "آیا مطمئن هستید که می‌خواهید این اتاق را حذف کنید؟"
}
},
Expand Down Expand Up @@ -274,8 +278,8 @@
"administration": {
"administration": "مدیریت",
"terms": "شرایط و ضوابط",
"privacy": "سیاست حفظ حریم خصوصی",
"privacy_policy": "سیاست حفظ حریم خصوصی",
"privacy": "اطلاعیه حفظ حریم خصوصی",
"privacy_policy": "اطلاعیه حفظ حریم خصوصی",
"change_term_links": "تغییر پیوندهای مقررات که در پایین صفحه نمایان می‌شوند",
"change_privacy_link": "پیوند حریم خصوصی که در پایین صفحه نمایان می‌شود را تغییر دهید",
"helpcenter": "مرکز راهنمایی",
Expand Down Expand Up @@ -413,7 +417,7 @@
"brand_color_updated": "رنگ برند به‌روز شده‌است.",
"brand_image_updated": "تصویر برند به‌روز شده‌است.",
"brand_image_deleted": "تصویر برند حذف شده‌است.",
"privacy_policy_updated": "سیاست حفظ حریم خصوصی به‌روز شدهاست.",
"privacy_policy_updated": "اطلاعیه حفظ حریم خصوصی به‌روز شده است.",
"helpcenter_updated": "پیوند مرکز راهنمایی به‌روز شده است.",
"terms_of_service_updated": "شرایط خدمات به‌روز شده‌است.",
"maintenance_updated": "اعلامیهٔ حالت تعمیر به‌روز شده است."
Expand All @@ -437,6 +441,7 @@
},
"error": {
"problem_completing_action": "این عمل نمی‌تواند تکمیل شود.\nلطفا دوباره تلاش کنید.",
"server_type_unavailable": "نوع سرور مورد نظر در دسترس نیست. لطفا نوع دیگری را در تنظیمات اتاق انتخاب کنید.",
"file_type_not_supported": "نوع پرونده پشتیبانی نمی‌شود.",
"file_size_too_large": "اندازهٔ پرونده خیلی بزرگ است.",
"file_upload_error": "پرونده نمی‌تواند بارگذاری شود.",
Expand Down Expand Up @@ -533,6 +538,11 @@
},
"url": {
"invalid": "نشانی اینترنتی معتبر نیست"
},
"text_form": {
"value": {
"required": "لطفا یک پیام وارد کنید"
}
}
},
"room": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License along
// with Greenlight; if not, see <http://www.gnu.org/licenses/>.

import React, { useEffect } from 'react';
import React, { useCallback, useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import { Button } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
Expand All @@ -25,39 +25,80 @@ import FormControl from '../../../shared_components/forms/FormControl';
import useTextForm from '../../../../hooks/forms/admin/site_settings/useTextForm';

export default function TextForm({ id, value, mutation: useUpdateSiteSettingsAPI }) {
const updateSiteSettingsAPI = useUpdateSiteSettingsAPI();
const updateSiteSettingsAPISetText = useUpdateSiteSettingsAPI();
const updateSiteSettingsAPIClearText = useUpdateSiteSettingsAPI();

const { t } = useTranslation();
const maintenanceBannerId = localStorage.getItem('maintenanceBannerId');

const { methods, fields } = useTextForm({ defaultValues: { value } });

const formText = useRef('');

useEffect(() => {
if (!methods) { return; }
methods.reset({ value });
if (methods) {
methods.reset({ value });
formText.current = value;
}
}, [methods, value]);

const dismissMaintenanceBannerToast = () => {
const maintenanceBannerId = localStorage.getItem('maintenanceBannerId');
if (maintenanceBannerId) {
toast.dismiss(maintenanceBannerId);
localStorage.removeItem('maintenanceBannerId');
}
};

// Function to clear the form
const clearForm = () => {
methods.reset({ value: '' });
toast.dismiss(maintenanceBannerId);
updateSiteSettingsAPI.mutate('');
dismissMaintenanceBannerToast();
if (formText.current) {
formText.current = '';
updateSiteSettingsAPIClearText.mutate('');
}
};

const handleSubmit = useCallback((formData) => {
if (formText.current !== formData[`${fields.value.hookForm.id}`]) {
dismissMaintenanceBannerToast();
formText.current = formData[`${fields.value.hookForm.id}`];
return updateSiteSettingsAPISetText.mutate(formData);
}
return null;
}, [updateSiteSettingsAPISetText.mutate]);

return (
<Form id={id} methods={methods} onSubmit={updateSiteSettingsAPI.mutate}>
<Form id={id} methods={methods} onSubmit={handleSubmit}>
<FormControl
field={fields.value}
aria-describedby={`${id}-submit-btn`}
type="text"
as="textarea"
rows={3}
noLabel
/>
<Button id={`${id}-clear-btn`} className="mb-2 float-end" variant="brand" onClick={clearForm} disabled={updateSiteSettingsAPI.isLoading}>
{updateSiteSettingsAPI.isLoading && <Spinner className="me-2" />}
{ t('admin.site_settings.administration.clear_banner') }
<Button
id={`${id}-clear-btn`}
className="mb-2 float-end"
variant="danger"
onClick={clearForm}
disabled={updateSiteSettingsAPIClearText.isLoading}
>
{updateSiteSettingsAPIClearText.isLoading && (
<Spinner className="me-2" />
)}
{t('admin.site_settings.administration.clear_banner')}
</Button>
<Button id={`${id}-submit-btn`} className="mb-2 float-end me-2" variant="brand" type="submit" disabled={updateSiteSettingsAPI.isLoading}>
{updateSiteSettingsAPI.isLoading && <Spinner className="me-2" />}
{ t('admin.site_settings.administration.set_text') }
<Button
id={`${id}-submit-btn`}
className="mb-2 float-end me-2"
variant="brand"
type="submit"
disabled={updateSiteSettingsAPISetText.isLoading}
>
{updateSiteSettingsAPISetText.isLoading && <Spinner className="me-2" />}
{t('admin.site_settings.administration.set_text')}
</Button>
</Form>
);
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/components/shared_components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export default function Header() {
const currentUser = useAuth();

let homePath = '/';
if (currentUser?.permissions?.CreateRoom === 'false') {
if (currentUser?.permissions?.CreateRoom === 'true') {
homePath = '/rooms';
} else if (currentUser?.permissions?.CreateRoom === 'false') {
homePath = '/home';
}

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/helpers/FileValidationHelper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ export const handleError = (error, t, toast) => {
toast.error(t('toast.error.file_type_not_supported'));
break;
default:
toast.error(t('toast.error.file_upload_error'));
toast.error(t('toast.error.problem_completing_action'));
}
};
2 changes: 2 additions & 0 deletions app/javascript/hooks/forms/admin/site_settings/useTextForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { useCallback, useMemo } from 'react';
export function useTextFormValidation() {
return useMemo(() => (yup.object({
// future add text validations
value: yup.string()
.required('forms.validations.text_form.value.required'),
})), []);
}

Expand Down
2 changes: 1 addition & 1 deletion config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ja:
invitation_to_join: BigBlueButtonへの招待
you_have_been_invited: "%{name}さんから、BigBlueButtonのアカウント作成に招待されています。"
get_started: 登録するには下のボタンをクリックし、手順にしたがってください。
valid_invitation: この招待は24時間有効です
valid_invitation: 招待は7日間有効です
sign_up: 登録
new_user_signup:
new_user: 新しいBigBlueButtonユーザーの登録
Expand Down
83 changes: 83 additions & 0 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
#
# Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below).
#
# This program is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; either version 3.0 of the License, or (at your option) any later
# version.
#
# Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with Greenlight; if not, see <http://www.gnu.org/licenses/>.

# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
# I18n.t "hello"
#
# In views, this is aliased to just `t`:
#
# <%= t("hello") %>
#
# To use a different locale, set it with `I18n.locale`:
#
# I18n.locale = :es
#
# This would use the information in config/locales/es.yml.
#
# The following keys must be escaped otherwise they will not be retrieved by
# the default I18n backend:
#
# true, false, on, off, yes, no
#
# Instead, surround them with single quotes.
#
# en:
# "true": "foo"
#
# To learn more, please read the Rails Internationalization guide
# available at https://guides.rubyonrails.org/i18n.html.

pl:
opengraph:
description: "Ucz się przy użyciu BigBlueButton, zaufanego open sourcowego rozwiązania w zakresie konferencji internetowych, które umożliwia bezproblemową wirtualną współpracę i edukację online."
meeting:
moderator_message: "By zaprosić kogoś na spotkanie, wyślij ten link:"
access_code: "Kod dostępu: %{code}"
email:
activation:
account_activation: Aktywacja konta
welcome_to_bbb: Witamy w BigBlueButton!
get_started: "Aby rozpocząć, aktywuj swoje konto, klikając przycisk poniżej."
activate_account: Aktywuj Konto
link_expires: Link wygaśnie w ciągu 24 godzin.
if_link_expires: "Jeśli link wygasł, zaloguj się i poproś o nowy e-mail aktywacyjny."
invitation:
invitation_to_join: Zaproszenie do BigBlueButton
you_have_been_invited: "Użytkownik %{name} wysłał Ci zaproszenie do utworzenia konta BigBlueButton."
get_started: "Aby się zarejestrować, kliknij przycisk poniżej i wykonaj kolejne kroki."
valid_invitation: Zaproszenie jest ważne przez 7 dni.
sign_up: Zarejestruj się
new_user_signup:
new_user: Nowa Rejestracja Użytkownika BigBlueButton
new_user_description: Nowy użytkownik zarejestrował się by używać BigBlueButton.
name: "Nazwa: %{name}"
email: "E-mail: %{email}"
admin_panel: "Panel Administratora"
take_action: "Aby wyświetlić nowego użytkownika lub podjąć niezbędne działanie, odwiedź Panel Administratora"
reset:
password_reset: Reset Hasła
password_reset_requested: "Jest nowa prośba o reset hasła dla %{email}."
password_reset_confirmation: "By zresetować hasło, Kliknij przycisk poniżej."
reset_password: Reset Hasła
link_expires: Link wygaśnie za 1 godzinę.
ignore_request: "Jeśli nie od Ciebie pochodzi dyspozycja resetu hasła, zignoruj tę wiadomość."
room:
new_room_name: "Pokój użytkownika %{username}"

0 comments on commit affe1cf

Please sign in to comment.