Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed last 2 instances of recordings showing up when recordings disabled #5518

Merged
merged 5 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/controllers/api/v1/rooms_configurations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
module Api
module V1
class RoomsConfigurationsController < ApiController
before_action only: %i[index show] do
before_action only: %i[index] do
ensure_authorized(%w[CreateRoom ManageSiteSettings ManageRoles ManageRooms], friendly_id: params[:friendly_id])
end
skip_before_action :ensure_authenticated, only: %i[show]

# GET /api/v1/rooms_configurations.json
# Fetches and returns all rooms configurations.
Expand Down
18 changes: 11 additions & 7 deletions app/javascript/components/home/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ import {
import { toast } from 'react-toastify';
import { useAuth } from '../../contexts/auth/AuthProvider';
import HomepageFeatureCard from './HomepageFeatureCard';
import useRoomConfigValue from '../../hooks/queries/rooms/useRoomConfigValue';

export default function HomePage() {
const { t } = useTranslation();
const currentUser = useAuth();
const navigate = useNavigate();
const [searchParams, setSearchParams] = useSearchParams();
const error = searchParams.get('error');
const { data: recordValue } = useRoomConfigValue('record');

// Redirects the user to the proper page based on signed in status and CreateRoom permission
useEffect(
Expand Down Expand Up @@ -88,13 +90,15 @@ export default function HomePage() {
icon={<ComputerDesktopIcon className="hi-s text-white" />}
/>
</Col>
<Col className="mb-3">
<HomepageFeatureCard
title={t('homepage.recording_title')}
description={t('homepage.recording_description')}
icon={<VideoCameraIcon className="hi-s text-white" />}
/>
</Col>
{ (recordValue !== 'false') && (
<Col className="mb-3">
<HomepageFeatureCard
title={t('homepage.recording_title')}
description={t('homepage.recording_description')}
icon={<VideoCameraIcon className="hi-s text-white" />}
/>
</Col>
)}
<Col className="mb-3">
<HomepageFeatureCard
title={t('homepage.settings_title')}
Expand Down
18 changes: 11 additions & 7 deletions app/javascript/components/rooms/room/join/JoinCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import RoomJoinPlaceholder from './RoomJoinPlaceholder';
import useRoomJoinForm from '../../../../hooks/forms/rooms/useRoomJoinForm';
import ButtonLink from '../../../shared_components/utilities/ButtonLink';
import Title from '../../../shared_components/utilities/Title';
import useRoomConfigValue from '../../../../hooks/queries/rooms/useRoomConfigValue';

export default function JoinCard() {
const { t } = useTranslation();
Expand All @@ -54,6 +55,7 @@ export default function JoinCard() {
const roomStatusAPI = useRoomStatus(friendlyId, joinInterval);

const { data: env } = useEnv();
const { data: recordValue } = useRoomConfigValue('record');

const { methods, fields } = useRoomJoinForm();

Expand Down Expand Up @@ -205,13 +207,15 @@ export default function JoinCard() {
<h1 className="mt-2">
{publicRoom?.data.name}
</h1>
<ButtonLink
variant="brand-outline"
className="mt-3 mb-0 cursor-pointer"
to={`/rooms/${friendlyId}/public_recordings`}
>
<span> <VideoCameraIcon className="hi-s text-brand" /> {t('view_recordings')} </span>
</ButtonLink>
{ (recordValue !== 'false') && (
<ButtonLink
variant="brand-outline"
className="mt-3 mb-0 cursor-pointer"
to={`/rooms/${friendlyId}/public_recordings`}
>
<span> <VideoCameraIcon className="hi-s text-brand" /> {t('view_recordings')} </span>
</ButtonLink>
)}
</Col>
<Col>
<Stack direction="vertical" gap={3}>
Expand Down
Loading