Conversation
shadcn hasn't updated their component for react-day-picker v9 yet, it's still on v8. However, in the styling docs of React Day Picker (https://daypicker.dev/docs/styling), they provide an unoffocial sample file (https://date-picker.luca-felix.com/) This is where this new version has been sourced, but all Typescript syntax has been stripped Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
…nto enhance-dashboard-module
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
b06edc6 to
aadbb1f
Compare
alvarobernal2412
left a comment
There was a problem hiding this comment.
The mashup response include is given by /computations/id where id is then computationGroup. Response example:
[
{
id: computationGroup,
value: complianceValue,
scope: trimmedScope,
evidences: computations,
period,
controlId,
},
]Each computation in evidence attribute has this structure:
id: d290f1ee-6c54-4b01-90e6-d701748f0851
computationGroup: 123e4567-e89b-12d3-a456-426614174000
value: true
scope: {"project": "showcase-GH-governify_bluejay-showcase", "class": "showcase", "member": "Javi_Fdez" }
evidences: [{"document": "Document confirming the computation"}]
period: { "from": "2022-04-07T02:00:00.000Z", "to": "2022-04-07T02:59:59.999Z" }
controlId: 2
You must take that into account for the mashup test response. Cheer up!
src/services/mashups.js
Outdated
| export async function executeNodeRedMashup(url, payload) { | ||
| const username = 'admin'; | ||
| const password = 'admin123'; | ||
|
|
||
| if (!username || !password) { | ||
| console.warn("Advertencia: Las credenciales de Node-RED no están configuradas correctamente. La autenticación podría fallar."); | ||
| // Considera lanzar un error o manejar esto de forma más robusta en producción. | ||
| } | ||
|
|
||
| // 2. Codificar las credenciales en Base64 | ||
| const credentials = encodeToBase64(`${username}:${password}`); | ||
|
|
||
| try { | ||
| const response = await nodeRedClient.post(`/api/v1/${url}`, payload, { | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| // 3. Añadir el encabezado Authorization | ||
| 'Authorization': `Basic ${credentials}` | ||
| } | ||
| }); | ||
| return response.data; | ||
| } catch (error) { | ||
| console.error('Error executing Node-RED mashup:', error.response ? error.response.data : error.message); | ||
| throw error; // Re-lanza el error para que sea manejado por el componente de UI | ||
| } |
There was a problem hiding this comment.
We have the nodeRedToken in the cookies so the username and password are not necessary.
| /** | ||
| * Crea un control de prueba en el backend. | ||
| * Ajustado para devolver directamente el objeto de respuesta del API, | ||
| * asumiendo que el control ya está en la raíz de la respuesta HTTP. | ||
| * | ||
| * @param {string} mashupName - El nombre del mashup para el que se está creando el control de prueba. | ||
| * @param {string} selectedCatalogId - El ID del catálogo seleccionado por el usuario en el modal. | ||
| * @returns {Promise<object>} - Promesa que resuelve con los datos del control creado. | ||
| */ |
There was a problem hiding this comment.
This should be in English
src/services/mashups.js
Outdated
| return tab; | ||
| }); | ||
|
|
||
| console.log("Flujos de Node-RED procesados:", allFlowsInfo); // Para depuración |
src/services/mashups.js
Outdated
|
|
||
| } catch (error) { | ||
| console.error("Error fetching all Node-RED flows:", error); | ||
| // Relanzar el error para que pueda ser capturado por el código que llama |
There was a problem hiding this comment.
This should be in English
src/pages/app/Mashups.jsx
Outdated
| // Asumimos que getAllNodeRedFlows devuelve también 'mainInputType' y 'url' | ||
| // Si no es así, deberías ajustar la llamada o el servicio getAllNodeRedFlows |
There was a problem hiding this comment.
This should be in English
There was a problem hiding this comment.
This file is a mix between a component and a page, a component must be reusable and a page must include only its features. E.g. The Mashup Page must only include the fetch, see (redirect to Details page), test mashup (redirect to Test Mashup Page) and delete features.
There was a problem hiding this comment.
Be careful with this type of changes because this form is already used for other features, if you need to change its logic, then create other form. If the logic you're introducing doesn't break other uses, then reuse this form.
- Add comprehensive IndexedDB manager class with CRUD operations - Support test storage by mashup ID with timestamp indexing - Include bulk operations for clearing tests - Provide singleton instance for app-wide usage
- Create useMashupTests hook for centralized test state - Integrate with IndexedDB for persistent storage - Provide both async and sync access patterns - Support CRUD operations with local state optimization
- Add PreviousTests component for test history management - Add TestResults component for current test output display - Include actions for viewing, deleting, and managing tests - Support formatted timestamps and result visualization
- Integrate embedded form with test result persistence - Update main form to support test history features - Improve form validation and error handling - Enhance user experience with better feedback
- Move test action to dropdown menu in Mashups list - Integrate test history and results in ControlCreationAndTestPage - Add test persistence across page reloads - Improve UX with previous test access and management
…scompliance/frontend into feature/mashup-test-button
This reverts commit dc9b39f.
Closes #58