mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
chore: sentry and nextjs major bumps (#633)
* chore: remove nextjs-config * build fix * sentry update * nextjs update * feature flags doc * update readme * explicit nextjs env vars + remove feature-unrelated things and obsolete vars from config * full config removal * remove force-dynamic from pages * compile fix * restore claude-deleted tests * no sentry backward compat * better .env.example * AUTHENTIK_REFRESH_TOKEN_URL not so required * accommodate auth system to requiredLogin feature --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"use client";
|
||||
import { useState } from "react";
|
||||
import { useState, use } from "react";
|
||||
import TopicHeader from "./topicHeader";
|
||||
import TopicWords from "./topicWords";
|
||||
import TopicPlayer from "./topicPlayer";
|
||||
@@ -18,14 +18,16 @@ import { useRouter } from "next/navigation";
|
||||
import { Box, Grid } from "@chakra-ui/react";
|
||||
|
||||
export type TranscriptCorrect = {
|
||||
params: {
|
||||
params: Promise<{
|
||||
transcriptId: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
export default function TranscriptCorrect({
|
||||
params: { transcriptId },
|
||||
}: TranscriptCorrect) {
|
||||
export default function TranscriptCorrect(props: TranscriptCorrect) {
|
||||
const params = use(props.params);
|
||||
|
||||
const { transcriptId } = params;
|
||||
|
||||
const updateTranscriptMutation = useTranscriptUpdate();
|
||||
const transcript = useTranscriptGet(transcriptId);
|
||||
const stateCurrentTopic = useState<GetTranscriptTopic>();
|
||||
|
||||
@@ -5,7 +5,7 @@ import useWaveform from "../useWaveform";
|
||||
import useMp3 from "../useMp3";
|
||||
import { TopicList } from "./_components/TopicList";
|
||||
import { Topic } from "../webSocketTypes";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useEffect, useState, use } from "react";
|
||||
import FinalSummary from "./finalSummary";
|
||||
import TranscriptTitle from "../transcriptTitle";
|
||||
import Player from "../player";
|
||||
@@ -15,13 +15,14 @@ import { useTranscriptGet } from "../../../lib/apiHooks";
|
||||
import { TranscriptStatus } from "../../../lib/transcript";
|
||||
|
||||
type TranscriptDetails = {
|
||||
params: {
|
||||
params: Promise<{
|
||||
transcriptId: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
const transcriptId = details.params.transcriptId;
|
||||
const params = use(details.params);
|
||||
const transcriptId = params.transcriptId;
|
||||
const router = useRouter();
|
||||
const statusToRedirect = [
|
||||
"idle",
|
||||
@@ -43,7 +44,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
|
||||
useEffect(() => {
|
||||
if (waiting) {
|
||||
const newUrl = "/transcripts/" + details.params.transcriptId + "/record";
|
||||
const newUrl = "/transcripts/" + params.transcriptId + "/record";
|
||||
// Shallow redirection does not work on NextJS 13
|
||||
// https://github.com/vercel/next.js/discussions/48110
|
||||
// https://github.com/vercel/next.js/discussions/49540
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use client";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect, useState, use } from "react";
|
||||
import Recorder from "../../recorder";
|
||||
import { TopicList } from "../_components/TopicList";
|
||||
import { useWebSockets } from "../../useWebSockets";
|
||||
@@ -14,19 +14,20 @@ import { useTranscriptGet } from "../../../../lib/apiHooks";
|
||||
import { TranscriptStatus } from "../../../../lib/transcript";
|
||||
|
||||
type TranscriptDetails = {
|
||||
params: {
|
||||
params: Promise<{
|
||||
transcriptId: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
const TranscriptRecord = (details: TranscriptDetails) => {
|
||||
const transcript = useTranscriptGet(details.params.transcriptId);
|
||||
const params = use(details.params);
|
||||
const transcript = useTranscriptGet(params.transcriptId);
|
||||
const [transcriptStarted, setTranscriptStarted] = useState(false);
|
||||
const useActiveTopic = useState<Topic | null>(null);
|
||||
|
||||
const webSockets = useWebSockets(details.params.transcriptId);
|
||||
const webSockets = useWebSockets(params.transcriptId);
|
||||
|
||||
const mp3 = useMp3(details.params.transcriptId, true);
|
||||
const mp3 = useMp3(params.transcriptId, true);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -47,7 +48,7 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
||||
if (newStatus && (newStatus == "ended" || newStatus == "error")) {
|
||||
console.log(newStatus, "redirecting");
|
||||
|
||||
const newUrl = "/transcripts/" + details.params.transcriptId;
|
||||
const newUrl = "/transcripts/" + params.transcriptId;
|
||||
router.replace(newUrl);
|
||||
}
|
||||
}, [webSockets.status?.value, transcript.data?.status]);
|
||||
@@ -75,7 +76,7 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
||||
<WaveformLoading />
|
||||
) : (
|
||||
// todo: only start recording animation when you get "recorded" status
|
||||
<Recorder transcriptId={details.params.transcriptId} status={status} />
|
||||
<Recorder transcriptId={params.transcriptId} status={status} />
|
||||
)}
|
||||
<VStack
|
||||
align={"left"}
|
||||
@@ -98,7 +99,7 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
||||
topics={webSockets.topics}
|
||||
useActiveTopic={useActiveTopic}
|
||||
autoscroll={true}
|
||||
transcriptId={details.params.transcriptId}
|
||||
transcriptId={params.transcriptId}
|
||||
status={status}
|
||||
currentTranscriptText={webSockets.accumulatedText}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use client";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect, useState, use } from "react";
|
||||
import { useWebSockets } from "../../useWebSockets";
|
||||
import { lockWakeState, releaseWakeState } from "../../../../lib/wakeLock";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -9,18 +9,19 @@ import FileUploadButton from "../../fileUploadButton";
|
||||
import { useTranscriptGet } from "../../../../lib/apiHooks";
|
||||
|
||||
type TranscriptUpload = {
|
||||
params: {
|
||||
params: Promise<{
|
||||
transcriptId: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
const TranscriptUpload = (details: TranscriptUpload) => {
|
||||
const transcript = useTranscriptGet(details.params.transcriptId);
|
||||
const params = use(details.params);
|
||||
const transcript = useTranscriptGet(params.transcriptId);
|
||||
const [transcriptStarted, setTranscriptStarted] = useState(false);
|
||||
|
||||
const webSockets = useWebSockets(details.params.transcriptId);
|
||||
const webSockets = useWebSockets(params.transcriptId);
|
||||
|
||||
const mp3 = useMp3(details.params.transcriptId, true);
|
||||
const mp3 = useMp3(params.transcriptId, true);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -50,7 +51,7 @@ const TranscriptUpload = (details: TranscriptUpload) => {
|
||||
if (newStatus && (newStatus == "ended" || newStatus == "error")) {
|
||||
console.log(newStatus, "redirecting");
|
||||
|
||||
const newUrl = "/transcripts/" + details.params.transcriptId;
|
||||
const newUrl = "/transcripts/" + params.transcriptId;
|
||||
router.replace(newUrl);
|
||||
}
|
||||
}, [webSockets.status?.value, transcript.data?.status]);
|
||||
@@ -84,7 +85,7 @@ const TranscriptUpload = (details: TranscriptUpload) => {
|
||||
Please select the file, supported formats: .mp3, m4a, .wav,
|
||||
.mp4, .mov or .webm
|
||||
</Text>
|
||||
<FileUploadButton transcriptId={details.params.transcriptId} />
|
||||
<FileUploadButton transcriptId={params.transcriptId} />
|
||||
</>
|
||||
)}
|
||||
{status && status == "uploaded" && (
|
||||
|
||||
Reference in New Issue
Block a user