Skip to content

Commit 48cb513

Browse files
feat: added databinder views
1 parent b394db5 commit 48cb513

16 files changed

Lines changed: 4064 additions & 73 deletions

File tree

src/App.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ import { Dashboards } from '@/pages/app/Dashboards';
1717
import { DashboardDetails } from '@/pages/app/dashboard/DashboardDetails';
1818
import { FolderDetails } from '@/pages/app/dashboard/FolderDetails';
1919
import { Editor } from '@/pages/app/Editor';
20+
import { Datasources } from '@/pages/app/datasource/Datasources';
21+
import { DatasourceCreate } from '@/pages/app/datasource/DatasourceCreate';
22+
import { DatasourceEdit } from '@/pages/app/datasource/DatasourceEdit';
23+
import { Linkers } from '@/pages/app/linker/Linkers';
24+
import { LinkerCreate } from '@/pages/app/linker/LinkerCreate';
25+
import { LinkerEdit } from '@/pages/app/linker/LinkerEdit';
2026
import MainLayout from '@/layouts/MainLayout';
2127
import AppLayout from '@/layouts/AppLayout';
2228
import { Toaster } from '@/components/ui/sonner';
@@ -63,6 +69,16 @@ function App() {
6369
<Route path=":id" element={<DashboardDetails />} />
6470
<Route path="folders/:id" element={<FolderDetails />} />
6571
</Route>
72+
<Route path="datasources">
73+
<Route index element={<Datasources />} />
74+
<Route path="new" element={<DatasourceCreate />} />
75+
<Route path=":id/edit" element={<DatasourceEdit />} />
76+
</Route>
77+
<Route path="linkers">
78+
<Route index element={<Linkers />} />
79+
<Route path="new" element={<LinkerCreate />} />
80+
<Route path=":id/edit" element={<LinkerEdit />} />
81+
</Route>
6682
<Route path="scopes" element={<Scopes />} />
6783
<Route path="mashups" element={<Mashups />} />
6884
<Route path="setting-2fa" element={<TwoFADetails />} />

src/components/catalog/CatalogControlsStep.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,14 @@ export function CatalogControlsStep({ initialControls = [], catalogId, onSubmit,
367367
</Button>
368368
</div>
369369
</CardHeader>
370-
<CardContent className="p-4 pt-2 text-left">
370+
<CardContent className="p-4 pt-2">
371+
<p className="text-left text-sm">{control.description}</p>
372+
371373

372374

373375
<div className="grid mt-2 gap-1 text-xs text-gray-500">
374-
<p> Description: <span className="text-primary">
375-
{control.description} </span></p>
376-
376+
<p className="text-left">Linker: SharePoint Linker</p>
377+
377378
<div className='flex'>Start Date: {new Date(control.startDate).toLocaleDateString()}</div>
378379
{control.endDate && <div className='flex'>End Date: {new Date(control.endDate).toLocaleDateString()}</div>}
379380
{control.scopes && Object.keys(control.scopes).length > 0 && (

src/components/layouts/sidebar.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Home, FolderOpen, Shapes, Workflow, FileSliders, ChartNoAxesCombined, ChevronRight, ChevronsUpDown, LogOut, ShieldHalf, SquareAsterisk } from 'lucide-react';
1+
import {Home, FolderOpen, Shapes, Workflow, FileSliders, ChartNoAxesCombined, ChevronRight, ChevronsUpDown, LogOut, ShieldHalf, SquareAsterisk, Database, Link2 } from 'lucide-react';
22
import { Link } from 'react-router';
33
import { MoreHorizontal } from 'lucide-react';
44
import {
@@ -54,6 +54,16 @@ const data = [
5454
url: '/app/dashboards',
5555
icon: ChartNoAxesCombined,
5656
},
57+
{
58+
title: 'Datasources',
59+
url: '/app/datasources',
60+
icon: Database,
61+
},
62+
{
63+
title: 'Linkers',
64+
url: '/app/linkers',
65+
icon: Link2,
66+
},
5767
{
5868
title: 'Scopes',
5969
url: '/app/scopes',

src/forms/control/new/form.jsx

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { cn } from '@/lib/utils';
1919
import { format } from 'date-fns';
2020
import { controlSchema } from './schemas';
2121
import { saveDraftCatalogId } from '@/utils/draftStorage';
22+
import { getAllLinkers } from '@/services/linkers';
2223

2324
export function NewControlForm({ catalogId, onClose, onSuccess, customSubmit = null }) {
2425
const [loading, setLoading] = useState(false);
@@ -30,6 +31,7 @@ export function NewControlForm({ catalogId, onClose, onSuccess, customSubmit = n
3031
const [scopeValue, setScopeValue] = useState('');
3132
const [selectedParam, setSelectedParam] = useState('');
3233
const [paramValue, setParamValue] = useState('');
34+
const [availableLinkers, setAvailableLinkers] = useState([]);
3335

3436
// Setup form with zod validation
3537
const form = useForm({
@@ -43,14 +45,16 @@ export function NewControlForm({ catalogId, onClose, onSuccess, customSubmit = n
4345
mashupId: '',
4446
params: {},
4547
scopes: {},
46-
catalogId: catalogId
48+
catalogId: catalogId,
49+
linkerId: '', // Añadido linkerId
4750
}
4851
});
4952

5053
const { watch, setValue, getValues } = form;
5154
const watchMashupId = watch('mashupId');
5255
const watchParams = watch('params');
5356
const watchScopes = watch('scopes');
57+
const watchLinkerId = form.watch('linkerId');
5458

5559
useEffect(() => {
5660
// Fetch available scopes for the dropdown
@@ -75,8 +79,20 @@ export function NewControlForm({ catalogId, onClose, onSuccess, customSubmit = n
7579
}
7680
};
7781

82+
// Fetch available linkers for the dropdown
83+
const fetchLinkers = async () => {
84+
try {
85+
const response = await getAllLinkers();
86+
setAvailableLinkers(response);
87+
} catch (error) {
88+
console.error('Error fetching linkers:', error);
89+
toast.error('Failed to fetch available linkers');
90+
}
91+
};
92+
7893
fetchScopes();
7994
fetchMashups();
95+
fetchLinkers();
8096
}, []);
8197

8298
// When mashupId changes, fetch the params
@@ -388,6 +404,35 @@ export function NewControlForm({ catalogId, onClose, onSuccess, customSubmit = n
388404
)}
389405
/>
390406

407+
{/* Nuevo campo para seleccionar Linker */}
408+
<FormField
409+
control={form.control}
410+
name="linkerId"
411+
render={({ field }) => (
412+
<FormItem>
413+
<FormLabel>Linker*</FormLabel>
414+
<Select
415+
onValueChange={field.onChange}
416+
defaultValue={field.value}
417+
>
418+
<FormControl>
419+
<SelectTrigger>
420+
<SelectValue placeholder="Selecciona un linker" />
421+
</SelectTrigger>
422+
</FormControl>
423+
<SelectContent className="max-h-60 overflow-y-auto">
424+
{availableLinkers.map((linker) => (
425+
<SelectItem key={linker.id} value={linker.id}>
426+
{linker.name}
427+
</SelectItem>
428+
))}
429+
</SelectContent>
430+
</Select>
431+
<FormMessage />
432+
</FormItem>
433+
)}
434+
/>
435+
391436
<div className="space-y-2">
392437
<FormLabel>Parameters*</FormLabel>
393438
<div className="flex space-x-2">

src/forms/dashboard/panel/form.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export function AddPanelForm({ dashboardUid, onClose, onSuccess, dashboardTimeRa
153153
// Create complete configuration for temporary dashboard preview
154154
const previewConfig = {
155155
title: panelData.title || 'Panel Preview',
156+
displayName: panelData.title || '',
156157
type: panelData.type,
157158
description: panelData.description || '',
158159
sql: rawSql || '',
@@ -394,7 +395,7 @@ export function AddPanelForm({ dashboardUid, onClose, onSuccess, dashboardTimeRa
394395
name="controlId"
395396
render={({ field }) => (
396397
<FormItem className="min-w-[200px] flex-1">
397-
<FormLabel>Associate with Control (Optional)</FormLabel>
398+
<FormLabel>Associate with Control*</FormLabel>
398399
<Select onValueChange={field.onChange} value={field.value}>
399400
<FormControl>
400401
<SelectTrigger>

src/pages/app/ComputationDetails.jsx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,49 @@ const columnHelper = createColumnHelper();
2525
// Mock evidences if needed when we don't have real data
2626
const mockEvidences = [
2727
{
28-
id: 'fbc4c50a-c21a-45f3-87af-27116ac8d56c',
29-
key: 'AND operation',
30-
value: [true, true],
28+
id: 'e1',
29+
key: 'procedure_formally_documented',
30+
value: true,
3131
result: true,
3232
from: '2025-01-01T01:00:00',
3333
to: '2025-01-01T01:59:59'
3434
},
35-
{
36-
id: '2cfd4036-22c7-4533-babf-b339f2237acb',
37-
key: 'url',
38-
value: 'https://github.com/statuscompliance/infrastructure/blob/examples/files/receipts/payment81001.pdf',
35+
{
36+
id: 'e2',
37+
key: 'signed_or_reviewed_by_stic',
38+
value: true,
3939
result: true,
4040
from: '2025-01-01T01:00:00',
4141
to: '2025-01-01T01:59:59'
4242
},
4343
{
44-
id: '3',
45-
key: 'password_length',
46-
value: 10,
44+
id: 'e3',
45+
key: 'detailed_steps_included',
46+
value: true,
4747
result: true,
4848
from: '2025-01-01T01:00:00',
4949
to: '2025-01-01T01:59:59'
5050
},
5151
{
52-
id: '4',
53-
key: 'special_char_present',
54-
value: false,
55-
result: false,
52+
id: 'e4',
53+
key: 'assigned_responsible_role',
54+
value: true,
55+
result: true,
5656
from: '2025-01-01T01:00:00',
5757
to: '2025-01-01T01:59:59'
5858
},
59+
{
60+
id: 'e5',
61+
key: 'guidelines_for_anomaly_reporting',
62+
value: true,
63+
result: true,
64+
from: '2025-01-01T01:00:00',
65+
to: '2025-01-01T01:59:59'
66+
}
5967
];
6068

69+
70+
6171
export function ComputationDetails() {
6272
const params = useParams();
6373
const location = useLocation();
@@ -182,7 +192,7 @@ export function ComputationDetails() {
182192
if (loading) {
183193
return (
184194
<Page
185-
className="mx-auto p-4 container space-y-6"
195+
className="container mx-auto p-4 space-y-6"
186196
catalogData={catalogData}
187197
computationDate={computationDate}
188198
>
@@ -195,7 +205,7 @@ export function ComputationDetails() {
195205

196206
return (
197207
<Page
198-
className="mx-auto p-4 container space-y-6"
208+
className="container mx-auto p-4 space-y-6"
199209
catalogData={catalogData}
200210
computationDate={computationDate}
201211
>

0 commit comments

Comments
 (0)