Skip to content

Feature/mashup-test-button#60

Open
tirirote wants to merge 46 commits intomainfrom
feature/mashup-test-button
Open

Feature/mashup-test-button#60
tirirote wants to merge 46 commits intomainfrom
feature/mashup-test-button

Conversation

@tirirote
Copy link
Collaborator

@tirirote tirirote commented Jul 1, 2025

Closes #58

alvarobernal2412 and others added 27 commits March 31, 2025 11:35
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>
@gitguardian
Copy link

gitguardian bot commented Jul 1, 2025

️✅ 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.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 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.

@github-actions github-actions bot added the 📦 Dependencies Pull requests that update a dependency file label Jul 1, 2025
@renovate renovate bot force-pushed the renovate/npm-(development) branch from b06edc6 to aadbb1f Compare July 1, 2025 22:42
Copy link
Member

@alvarobernal2412 alvarobernal2412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment on lines 203 to 227
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
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the nodeRedToken in the cookies so the username and password are not necessary.

Comment on lines 157 to 165
/**
* 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.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in English

return tab;
});

console.log("Flujos de Node-RED procesados:", allFlowsInfo); // Para depuración
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed


} 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in English

Comment on lines 75 to 76
// Asumimos que getAllNodeRedFlows devuelve también 'mainInputType' y 'url'
// Si no es así, deberías ajustar la llamada o el servicio getAllNodeRedFlows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in English

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alvarobernal2412 alvarobernal2412 changed the base branch from renovate/npm-(development) to main July 3, 2025 09:35
alvarobernal2412 and others added 10 commits July 3, 2025 11:36
- 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
@github-actions github-actions bot added the 🤯 size/xl Pull request size XL label Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 Dependencies Pull requests that update a dependency file 🤯 size/xl Pull request size XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Test" Button in Mashups View

3 participants