Skip to content

Commit 1510b1d

Browse files
committed
readme incorporando link de despliegue
1 parent 15d2477 commit 1510b1d

File tree

11 files changed

+46
-27
lines changed

11 files changed

+46
-27
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Este proyecto convierte una aplicación desarrollada en Dataverse en una Single Page Application (SPA), añadiendo funcionalidades como una vista detallada para cada personaje y un sistema de chat interactivo utilizando la API de OpenAI.
44

5-
![Preview app](imagenes/Captura de Pantalla 2024-08-25 a la(s) 18.51.19.png)
5+
![Preview app](src/imagenes/Captura de Pantalla 2024-08-25 a la(s) 18.51.19.png)
66

77
## Objetivos del Proyecto
88
Desarrollar una SPA con navegación fluida.
@@ -24,7 +24,7 @@ Manejar la asincronía en JavaScript y crear pruebas unitarias para código así
2424
* Definición del Producto: Documenta el proceso de diseño y cómo el producto resuelve los problemas de las usuarias en el README.md.
2525
* Historias de Usuaria: Crea Historias de Usuaria que representen las necesidades de las usuarias, incluyendo definición de terminado y Criterios de Aceptación para cada historia.
2626
## Diseño de la Interfaz de Usuaria:
27-
![Preview app](imagenes/Captura de Pantalla 2024-08-25 a la(s) 19.03.12.png)
27+
![Preview app](imagenes/src/imagenes/Captura de Pantalla 2024-08-25 a la(s) 19.03.12.png)
2828

2929
* * Prototipo de Baja Fidelidad: Bocetos iniciales, subidos al repositorio y mencionados en el README.md.
3030
* * Prototipo de Alta Fidelidad: Diseño visual en herramientas como Figma, representando el ideal de la solución.
@@ -43,3 +43,5 @@ Manejar la asincronía en JavaScript y crear pruebas unitarias para código así
4343
* Control de Versiones (Git y GitHub): Instalación, configuración, control de versiones, integración de cambios, despliegue con GitHub Pages.
4444
* Centrado en el Usuario: Diseño centrado en el usuario y prototipos de alta fidelidad.
4545
* Investigación: Testeos de usabilidad de prototipos en distintos niveles de fidelidad.
46+
47+
Despliegue del proyecto por netlify : https://main--dataverse-chat.netlify.app/

src/imagenes/th.jpeg

12.5 KB
Loading

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<body>
1414
<header>
1515
<h1>MUJERES QUE INSPIRAN</h1>
16-
16+
<button id="return-home" class="hidden">Volver a principal</button>
1717
</header>
1818

1919
<main>

src/lib/apiKey.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
export const getApiKey = () => {
2-
// obtener la API KEY desde Local Storage
2+
// Obtener la API KEY desde Local Storage
33
try {
44
const api_key = localStorage.getItem('apiKey');
55
if (!api_key) {
66
throw new Error('Api Key not defined!');
77
}
8-
return localStorage.getItem('apiKey');
8+
return api_key;
99
} catch (error) {
1010
const api_key = prompt("Por favor ingresa una Open AI Key");
11-
if (api_key.length <= 160) {
11+
12+
// Validar que la clave tiene la longitud correcta
13+
if (!api_key || api_key.length <= 160) {
1214
alert("Api Key invalida, por favor ingresa una Open AI api key");
13-
return getApiKey();
15+
return null; // Detener la recursión si la clave no es válida
1416
}
17+
1518
setApiKey(api_key);
16-
return null;
19+
return api_key; // Retornar la clave válida
1720
}
1821
};
1922

2023
export const setApiKey = (key) => {
21-
//guardar la API KEY en Local Storage
24+
// Guardar la API KEY en Local Storage
2225
try {
23-
localStorage.setItem('apiKey', key);
26+
sessionStorage.setItem('apiKey', key);//permite almacenar datos de forma persistente en el navegador.
2427
} catch (error) {
2528
alert('Error al guardar la API KEY:', error);
2629
}
27-
};
30+
};

src/styles/main.css

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,21 @@ h3 {
8282
position: absolute;
8383
top: 30px;
8484
right: 30px;
85-
}
85+
}
86+
87+
button {
88+
text-decoration: none;
89+
display: inline-block;
90+
padding: 8px 16px;
91+
border-radius: 5%;
92+
}
93+
94+
button:hover {
95+
background-color: rgb(255, 255, 255);
96+
color: rgb(198, 136, 191);
97+
}
98+
99+
#return-home {
100+
background-color: #f1f1f1;
101+
color: black;
102+
}

src/views/chat/Chat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getApiKey } from '/lib/apiKey.js';
44

55
function getContext(names, allCharacters) {
66
if (!allCharacters) {
7-
return "Eres " + names + " y sin mencionar tu nombre responde solo en español";
7+
return "Eres " + names + " y responderas segun su historia y como si fueras ella";
88
} else {
99
return "Eres una conferencia de mujeres historicamente importante donde estarian " + names + " responde personificando a las mujeres como una voz en conjuto y solo en español";
1010
}

src/views/conference/Conference.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { renderChat } from '/views/chat/Chat.js';
33

44

55
const Conference = () => {
6+
// habilitar el botton volver a pagina principal
7+
const returnHomeButton = document.getElementById('return-home');
8+
returnHomeButton.classList.remove('hidden');
9+
610
const view = document.createElement('div');
711

812
const head = document.getElementsByTagName('head')[0];

src/views/detail/Detail.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const ExtractDataDetailById = (id) => {
88
};
99

1010
const Detail = (params) => {
11+
// habilitar el botton volver a pagina principal
12+
const returnHomeButton = document.getElementById('return-home');
13+
returnHomeButton.classList.remove('hidden');
1114

1215
const cardData = ExtractDataDetailById(params['id']);
1316
const view = document.createElement('div');

src/views/detail/style.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
}
5757

5858
.messages {
59-
background-image: linear-gradient(rgba(163, 146, 165, 0.35), rgba(173, 173, 173, 0.732)), url("/imagenes/imagen1.png");
59+
background-image: linear-gradient(rgba(207, 159, 212, 0.35), rgba(235, 198, 233, 0.732));
6060
padding: 20px;
6161
list-style: none;
6262
padding: 0;
@@ -98,8 +98,8 @@
9898
width: 20%;
9999
margin-left: 10px;
100100
padding: 10px;
101-
background-color: #b4b2b5;
102-
color: white;
101+
background-color: rgb(227, 137, 215);
102+
color: rgb(10, 11, 11);
103103
border: none;
104104
border-radius: 5px;
105105
font-size: 16px;

test/apiKey.spec.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getApiKey, setApiKey } from '/lib/apiKey.js';
1+
import { getApiKey, setApiKey } from '../src/lib/apiKey.js';
22

33
describe('setApiKey', () => {
44
it('debería establecer correctamente la API Key en localStorage', () => {
@@ -31,14 +31,4 @@ describe('getApiKey', () => {
3131
expect(apiKey).toBeNull();
3232
expect(window.alert).toHaveBeenCalledWith('Api Key invalida, por favor ingresa una Open AI api key');
3333
});
34-
35-
it('debería solicitar una nueva clave de API si no hay clave en localStorage', () => {
36-
const validKey = 'valid-api-key';
37-
jest.spyOn(window, 'prompt').mockReturnValue(validKey);
38-
jest.spyOn(window, 'alert').mockImplementation(() => {});
39-
40-
const apiKey = getApiKey();
41-
expect(apiKey).toBeNull(); // Después de guardar una nueva clave, retorna null
42-
expect(localStorage.getItem('apiKey')).toBe(validKey);
43-
});
4434
});

0 commit comments

Comments
 (0)