mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-01 18:19:43 +00:00
Update
This commit is contained in:
1 parent
358c2be0ee
commit
b10eae1bf3
26 files changed
+2509
-53
No files matched your search
+72
-26
@@ -1,34 +1,80 @@
|
||||
import { Admin, Resource } from "react-admin";
|
||||
import { dataProvider } from "./providers/supabaseProvider";
|
||||
import { auditDataProvider } from "./providers/auditDataProvider";
|
||||
import { PackList, PackEdit, PackCreate } from "./resources/packs";
|
||||
import { QuestionList, QuestionEdit, QuestionCreate } from "./resources/questions";
|
||||
import { ProfileList, ResponseList } from "./resources/users";
|
||||
import { authProvider } from "./providers/authProvider";
|
||||
import { ProfileList, ProfileShow, ProfileEdit, ResponseList } from "./resources/users";
|
||||
import { CoupleList } from "./resources/couples";
|
||||
import { MatchList, MatchShow } from "./resources/matches";
|
||||
import { AuditLogList } from "./resources/auditLogs";
|
||||
import { authProvider, AdminPermissions } from "./providers/authProvider";
|
||||
|
||||
const App = () => (
|
||||
<Admin dataProvider={dataProvider} authProvider={authProvider} requireAuth>
|
||||
<Resource
|
||||
name="question_packs"
|
||||
list={PackList}
|
||||
edit={PackEdit}
|
||||
create={PackCreate}
|
||||
recordRepresentation="name"
|
||||
/>
|
||||
<Resource
|
||||
name="questions"
|
||||
list={QuestionList}
|
||||
edit={QuestionEdit}
|
||||
create={QuestionCreate}
|
||||
/>
|
||||
<Resource
|
||||
name="profiles"
|
||||
list={ProfileList}
|
||||
/>
|
||||
<Resource
|
||||
name="responses"
|
||||
list={ResponseList}
|
||||
/>
|
||||
<Resource name="couples" />
|
||||
<Admin
|
||||
dataProvider={auditDataProvider}
|
||||
authProvider={authProvider}
|
||||
requireAuth
|
||||
>
|
||||
{(permissions: AdminPermissions) => (
|
||||
<>
|
||||
{/* Question Packs - accessible to all admins */}
|
||||
<Resource
|
||||
name="question_packs"
|
||||
list={PackList}
|
||||
edit={PackEdit}
|
||||
create={PackCreate}
|
||||
recordRepresentation="name"
|
||||
options={{ label: 'Question Packs' }}
|
||||
/>
|
||||
|
||||
{/* Questions - accessible to all admins */}
|
||||
<Resource
|
||||
name="questions"
|
||||
list={QuestionList}
|
||||
edit={QuestionEdit}
|
||||
create={QuestionCreate}
|
||||
options={{ label: 'Questions' }}
|
||||
/>
|
||||
|
||||
{/* Super admin only resources */}
|
||||
{permissions?.role === 'super_admin' && (
|
||||
<>
|
||||
<Resource
|
||||
name="profiles"
|
||||
list={ProfileList}
|
||||
show={ProfileShow}
|
||||
edit={ProfileEdit}
|
||||
recordRepresentation="name"
|
||||
options={{ label: 'Users' }}
|
||||
/>
|
||||
<Resource
|
||||
name="couples"
|
||||
list={CoupleList}
|
||||
options={{ label: 'Relationships' }}
|
||||
/>
|
||||
<Resource
|
||||
name="matches"
|
||||
list={MatchList}
|
||||
show={MatchShow}
|
||||
options={{ label: 'Matches & Chats' }}
|
||||
/>
|
||||
<Resource
|
||||
name="responses"
|
||||
list={ResponseList}
|
||||
options={{ label: 'Responses' }}
|
||||
/>
|
||||
<Resource
|
||||
name="messages"
|
||||
options={{ label: 'Messages' }}
|
||||
/>
|
||||
<Resource
|
||||
name="audit_logs"
|
||||
list={AuditLogList}
|
||||
options={{ label: 'Audit Logs' }}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Admin>
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user