Implemented suggestions by Matthieu

This commit is contained in:
Andreas
2024-01-01 10:31:43 +07:00
parent c66385b0d0
commit c603e279df
9 changed files with 65 additions and 106 deletions

View File

@@ -18,11 +18,11 @@ import { SESSION_COOKIE_NAME } from "../lib/fief";
const poppins = Poppins({ subsets: ["latin"], weight: ["200", "400", "600"] }); const poppins = Poppins({ subsets: ["latin"], weight: ["200", "400", "600"] });
export const viewport: Viewport = { export const viewport: Viewport = {
themeColor: 'black', themeColor: "black",
width: "device-width", width: "device-width",
initialScale: 1, initialScale: 1,
maximumScale: 1, maximumScale: 1,
} };
export const metadata: Metadata = { export const metadata: Metadata = {
metadataBase: new URL(process.env.DEV_URL || "https://reflector.media"), metadataBase: new URL(process.env.DEV_URL || "https://reflector.media"),

View File

@@ -75,8 +75,7 @@ const TranscriptRecord = (details: TranscriptDetails) => {
}, [webSockets.status.value, transcript.response?.status]); }, [webSockets.status.value, transcript.response?.status]);
useEffect(() => { useEffect(() => {
if (transcript.response?.status === "ended") if (transcript.response?.status === "ended") mp3.getNow();
mp3.getNow();
}, [transcript.response]); }, [transcript.response]);
useEffect(() => { useEffect(() => {

View File

@@ -35,7 +35,7 @@ const useCreateTranscript = (): UseTranscript => {
); );
setErrorState(err); setErrorState(err);
setLoading(false); setLoading(false);
}) });
}; };
return { transcript, loading, error, create }; return { transcript, loading, error, create };

View File

@@ -21,11 +21,10 @@ export default function FileUploadButton(props: FileUploadButton) {
console.log("Calling api.v1TranscriptRecordUpload()..."); console.log("Calling api.v1TranscriptRecordUpload()...");
// Create an object of the expected type // Create an object of the expected type
const uploadData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = const uploadData = {
{ file: file,
file: file, // Add other properties if required by the type definition
// Add other properties if required by the type definition };
};
api?.v1TranscriptRecordUpload(props.transcriptId, uploadData); api?.v1TranscriptRecordUpload(props.transcriptId, uploadData);
} }

View File

@@ -86,29 +86,28 @@ const ShareLink = (props: ShareLinkProps) => {
)} )}
{isOwner && api && ( {isOwner && api && (
<div className="relative">
<div className="relative"> <SelectSearch
<SelectSearch className="select-search--top select-search"
className="select-search--top select-search" options={[
options={[ { name: "Private", value: "private" },
{ name: "Private", value: "private" }, { name: "Secure", value: "semi-private" },
{ name: "Secure", value: "semi-private" }, { name: "Public", value: "public" },
{ name: "Public", value: "public" }, ]}
]} value={shareMode?.toString()}
value={shareMode?.toString()} onChange={updateShareMode}
onChange={updateShareMode} closeOnSelect={true}
closeOnSelect={true} />
/> {shareLoading && (
{shareLoading && ( <div className="h-4 w-4 absolute top-1/3 right-3 z-10">
<div className="h-4 w-4 absolute top-1/3 right-3 z-10"> <FontAwesomeIcon
<FontAwesomeIcon icon={faSpinner}
icon={faSpinner} className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-4 w-4"
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-4 w-4" />
/> </div>
</div> )}
)} </div>
</div> )}
)}
</div> </div>
)} )}
{!requireLogin && ( {!requireLogin && (

View File

@@ -59,37 +59,37 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
useEffect(() => { useEffect(() => {
document.onkeyup = (e) => { document.onkeyup = (e) => {
if (e.key === "a" && process.env.NEXT_PUBLIC_ENV === "development") { if (e.key === "a" && process.env.NEXT_PUBLIC_ENV === "development") {
const segments : GetTranscriptSegmentTopic[] = [ const segments: GetTranscriptSegmentTopic[] = [
{ {
speaker: 1, speaker: 1,
start: 0, start: 0,
text: "This is the transcription of an example title", text: "This is the transcription of an example title",
}, },
{ {
speaker: 2, speaker: 2,
start: 10, start: 10,
text: "This is the second speaker", text: "This is the second speaker",
}, },
{ {
speaker: 3, speaker: 3,
start: 90, start: 90,
text: "This is the third speaker", text: "This is the third speaker",
}, },
{ {
speaker: 4, speaker: 4,
start: 90, start: 90,
text: "This is the fourth speaker", text: "This is the fourth speaker",
}, },
{ {
speaker: 5, speaker: 5,
start: 123, start: 123,
text: "This is the fifth speaker", text: "This is the fifth speaker",
}, },
{ {
speaker: 6, speaker: 6,
start: 300, start: 300,
text: "This is the sixth speaker", text: "This is the sixth speaker",
} },
]; ];
setTranscriptText("Lorem Ipsum"); setTranscriptText("Lorem Ipsum");
@@ -310,8 +310,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
if (!transcriptId || !api) return; if (!transcriptId || !api) return;
api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => { api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => {});
});
const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`; const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`;
let ws = new WebSocket(url); let ws = new WebSocket(url);

View File

@@ -8,8 +8,7 @@
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"format": "prettier --write .", "format": "prettier --write .",
"openapi": "openapi --input http://127.0.0.1:1250/openapi.json --name OpenApi --output app/api && yarn format", "openapi": "openapi --input http://127.0.0.1:1250/openapi.json --name OpenApi --output app/api && yarn format"
"openapi-old": "openapi-generator-cli generate -i http://localhost:1250/openapi.json -g typescript-fetch -o app/api && yarn format"
}, },
"dependencies": { "dependencies": {
"@fief/fief": "^0.13.5", "@fief/fief": "^0.13.5",
@@ -47,7 +46,6 @@
"devDependencies": { "devDependencies": {
"@openapitools/openapi-generator-cli": "^2.7.0", "@openapitools/openapi-generator-cli": "^2.7.0",
"@types/react": "18.2.20", "@types/react": "18.2.20",
"openapi-typescript": "^6.7.3",
"openapi-typescript-codegen": "^0.25.0", "openapi-typescript-codegen": "^0.25.0",
"prettier": "^3.0.0" "prettier": "^3.0.0"
} }

View File

@@ -19,8 +19,7 @@
} }
], ],
"strictNullChecks": true, "strictNullChecks": true,
"downlevelIteration": true, "downlevelIteration": true
"target": "ES2020"
}, },
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"], "include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"] "exclude": ["node_modules"]

View File

@@ -31,11 +31,6 @@
dependencies: dependencies:
regenerator-runtime "^0.14.0" regenerator-runtime "^0.14.0"
"@fastify/busboy@^2.0.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff"
integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==
"@fief/fief@^0.13.5": "@fief/fief@^0.13.5":
version "0.13.5" version "0.13.5"
resolved "https://registry.yarnpkg.com/@fief/fief/-/fief-0.13.5.tgz#01ac833ddff0b84f2e1737cc168721568b0e7a39" resolved "https://registry.yarnpkg.com/@fief/fief/-/fief-0.13.5.tgz#01ac833ddff0b84f2e1737cc168721568b0e7a39"
@@ -613,11 +608,6 @@ agent-base@6:
dependencies: dependencies:
debug "4" debug "4"
ansi-colors@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b"
integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==
ansi-escapes@^4.2.1: ansi-escapes@^4.2.1:
version "4.3.2" version "4.3.2"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e"
@@ -1532,7 +1522,7 @@ fast-glob@^3.2.12:
merge2 "^1.3.0" merge2 "^1.3.0"
micromatch "^4.0.4" micromatch "^4.0.4"
fast-glob@^3.2.9, fast-glob@^3.3.1, fast-glob@^3.3.2: fast-glob@^3.2.9, fast-glob@^3.3.1:
version "3.3.2" version "3.3.2"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
@@ -2844,18 +2834,6 @@ openapi-typescript-codegen@^0.25.0:
handlebars "^4.7.7" handlebars "^4.7.7"
json-schema-ref-parser "^9.0.9" json-schema-ref-parser "^9.0.9"
openapi-typescript@^6.7.3:
version "6.7.3"
resolved "https://registry.yarnpkg.com/openapi-typescript/-/openapi-typescript-6.7.3.tgz#7fe131a28551c8996e4a680e4698d0e1206635ba"
integrity sha512-es3mGcDXV6TKPo6n3aohzHm0qxhLyR39MhF6mkD1FwFGjhxnqMqfSIgM0eCpInZvqatve4CxmXcMZw3jnnsaXw==
dependencies:
ansi-colors "^4.1.3"
fast-glob "^3.3.2"
js-yaml "^4.1.0"
supports-color "^9.4.0"
undici "^5.28.2"
yargs-parser "^21.1.1"
ora@^5.4.1: ora@^5.4.1:
version "5.4.1" version "5.4.1"
resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18"
@@ -3734,13 +3712,6 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3" has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2" which-boxed-primitive "^1.0.2"
undici@^5.28.2:
version "5.28.2"
resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.2.tgz#fea200eac65fc7ecaff80a023d1a0543423b4c91"
integrity sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==
dependencies:
"@fastify/busboy" "^2.0.0"
unified@^11.0.0: unified@^11.0.0:
version "11.0.3" version "11.0.3"
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.3.tgz#e141be0fe466a2d28b2160f62712bc9cbc08fdd4" resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.3.tgz#e141be0fe466a2d28b2160f62712bc9cbc08fdd4"
@@ -3961,11 +3932,6 @@ yargs-parser@^20.2.2:
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
yargs-parser@^21.1.1:
version "21.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
yargs@^16.2.0: yargs@^16.2.0:
version "16.2.0" version "16.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"