Skip to content
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
5 changes: 5 additions & 0 deletions frontend/chat-ui/src/aws-amplify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const Amplify = {
configure() {
// No-op stub used when aws-amplify package is unavailable.
}
}
46 changes: 10 additions & 36 deletions frontend/chat-ui/src/components/TestApi.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React, { useState } from 'react';
import api from '../api';
import React, { useState } from 'react'
import api from '../api'

export default function TestApi() {
const [resp, setResp] = useState(null);
const [err, setErr] = useState(null);
const [resp, setResp] = useState(null)
const [err, setErr] = useState(null)

async function hit() {
try {
setErr(null);
const data = await api.get('/health');
setResp(JSON.stringify(data, null, 2));
setErr(null)
const data = await api.get('/health')
setResp(JSON.stringify(data, null, 2))
} catch (e) {
setResp(null);
setErr(e.message || String(e));
setResp(null)
setErr(e.message || String(e))
}
}

Expand All @@ -24,31 +24,5 @@ export default function TestApi() {
{err && <pre className="text-red-600">{err}</pre>}
{resp && <pre className="whitespace-pre-wrap">{resp}</pre>}
</div>
);
}
import React, { useState } from 'react';
import api from '../api';

export default function TestApi() {
const [resp, setResp] = useState();
const [err, setErr] = useState();

async function hit() {
try {
const data = await api.get('/health'); // or whatever route you have
setResp(JSON.stringify(data, null, 2));
setErr(null);
} catch (e) {
setErr(e.message || 'error');
setResp(null);
}
}

return (
<div>
<button onClick={hit}>Call API</button>
{err && <pre style={{color:'red'}}>{err}</pre>}
{resp && <pre>{resp}</pre>}
</div>
);
)
}
1 change: 1 addition & 0 deletions frontend/chat-ui/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Placeholder stylesheet for Amplify config */
3 changes: 2 additions & 1 deletion frontend/chat-ui/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { Amplify } from 'aws-amplify'
// Local stub replacing external aws-amplify dependency
import { Amplify } from './aws-amplify.js'
import App from './App.jsx'
import './index.css'

Expand Down
1 change: 1 addition & 0 deletions scripts/hardcoded-url-allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ backend/federation/federationSyncJob.js
frontend/user_login.js
frontend/federationStatusCLI.js
README.md
frontend/chat-ui/.env.local