Skip to content

Commit 35faca8

Browse files
authored
chore: sprint 3 merge
2 parents 6230758 + 431a33b commit 35faca8

32 files changed

+910
-302
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ Na tabela abaixo é possível visualizar a divisão de tarefas do Backlog por Sp
4141
| 02 | Construção das interfaces para CADASTRO, ATUALIZAÇÃO, CONSULTA E EXCLUSÃO de Domínio de Dados | :heavy_check_mark: | (70) Média |
4242
| 02 | Construção da interface de CONSULTA do Perfil do usuário conectado | :heavy_check_mark: | (65) Média |
4343
| |
44-
| 03 | Construção da interface e métodos de RECUPERAÇÃO de SENHA do Usuário | :hourglass: | (55) Média |
45-
| 03 | Desenvolvimento de métodos para salvar LOG das manobras realizadas | :hourglass: | (50) Média |
46-
| 03 | Apromirar filtro da listagem de equipamentos | :hourglass: | (40) Média |
44+
| 03 | Construção da interface e métodos de RECUPERAÇÃO de SENHA do Usuário | :heavy_check_mark: | (60) Média |
45+
| 03 | Construção de componente para a troca de SENHA do Usuário | :heavy_check_mark: | (55) Média |
46+
| 03 | Construção da interface e métodos para visualizar LOG/HISTÓRICO das manobras realizadas | :heavy_check_mark: | (50) Média |
47+
| 03 | Apromirar filtro da listagem de equipamentos | :heavy_check_mark: | (40) Média |
4748
| |
4849
| 04 | Construção da interface para visualizar a LISTAGEM de Equipamentos próximos a localização do usuário conectado |:hourglass: | (45) Média |
4950
| 04 | Construção da interface de MAPA para a LISTAGEM dos Equipamentos cadastrados | :hourglass: | (35) Baixa |
@@ -62,7 +63,7 @@ Na tabela abaixo é possível visualizar os resultados de cada Sprint clicando e
6263
| :----: | :--------: | :----------------: | :-----------------------------------------: |
6364
| 01 | 24/09/2023 | :heavy_check_mark: | [ver relatório](/docs/relatorio-sprint1.md) |
6465
| 02 | 15/10/2023 | :heavy_check_mark: | [ver relatório](/docs/relatorio-sprint2.md) |
65-
| 03 | 05/11/2023 | :hourglass: | [ver relatório](/docs/relatorio-sprint3.md) |
66+
| 03 | 05/11/2023 | :heavy_check_mark: | [ver relatório](/docs/relatorio-sprint3.md) |
6667
| 04 | 26/11/2023 | :hourglass: | [ver relatório](/docs/relatorio-sprint4.md) |
6768

6869
<br />
@@ -90,6 +91,16 @@ https://github.com/CodeLabFatec/EquipControl/assets/26208169/ec11063c-7fbf-4d4d-
9091

9192
</p>
9293

94+
<br />
95+
96+
<h4> Entrega da Sprint 3 </h4>
97+
98+
<p align="center">
99+
100+
https://github.com/CodeLabFatec/EquipControl/assets/26208169/df37f11a-10df-4dcb-b96b-c2353b29f0ed
101+
102+
</p>
103+
93104
<span id="tecnologias">
94105

95106
## 🛠️ Tecnologias

assets/usuario.png

18.6 KB
Loading

docs/relatorio-sprint3.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<br id="topo">
2+
3+
<h1 align="center">EquipControl - Terceira entrega</h1>
4+
5+
<p align="center">
6+
<a href="#mvp">MVP</a> |
7+
<a href="#backlog">Backlog</a> |
8+
<a href="#entrega">Entrega</a> |
9+
<a href="#burndown">Burndown</a> |
10+
</p>
11+
<span id="mvp">
12+
13+
<h1> :dart: MVP </h1>
14+
<p align="justify">O MVP da terceira entrega é o sistema de recuperação de senha do usuário. Além disso, também foi entregue o histórico de manobras realizadas no equipamento e também a possibilidade do usuário trocar a própria senha.</p>
15+
16+
<span id="backlog">
17+
18+
## 📌 Backlog
19+
20+
| Atividade | User story |
21+
| :-------- | :--------- |
22+
| Construção da interface e métodos de RECUPERAÇÃO de SENHA do Usuário | COMO um usuário EU QUERO conseguir recuperar minha senha PARA QUE eu possa voltar a acessar o aplicativo caso eu perca/esqueça minha senha antiga |
23+
| Construção de componente para a troca de SENHA do Usuário | COMO um usuário EU QUERO poder trocar minha senha PARA QUE eu possa ter um melhor controle do meu acesso ao aplicativo |
24+
| Construção da interface e métodos para visualizar LOG/HISTÓRICO das manobras realizadas | COMO um usuário EU QUERO conseguir visualizar um histórico de manobras de determinado equipamento PARA QUE possa haver um registro de todas as manobras que foram realizadas para cada equipamento cadastro |
25+
| Apromirar filtro da listagem de equipamentos | COMO um usuário EU QUERO filtrar minha busca de equipamentos na homepage PARA QUE eu consiga encontrar um determinado equipamento com maior facilidade |
26+
27+
<span id="entrega">
28+
29+
## 👩‍💻 Entrega
30+
<p align="center">
31+
32+
https://github.com/CodeLabFatec/EquipControl/assets/26208169/df37f11a-10df-4dcb-b96b-c2353b29f0ed
33+
34+
</p>
35+
36+
<span id="burndown">
37+
38+
## 📉 Burndown
39+
40+
![image](https://github.com/CodeLabFatec/EquipControl/assets/26208169/163e0e4d-e6d1-4bf3-a9dc-46c61cb1a7a6)
41+
42+
<br>
43+
44+
[Voltar ao topo](#topo)
45+
46+
<div align='center' height='70'>
47+
48+
![Logo Fatec](https://github.com/thaleskerber/Projeto-Integrador-4-Semestre/assets/26208169/c5407beb-d912-41da-afbb-13b054a55885)
49+
50+
<h5 align="center"> Projeto Integrador - Faculdade de Tecnologia de São José dos Campos - Prof. Jessen Vidal </h5>
51+
</div>

src/helpers/models/equipment.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Files} from './files';
33
export interface Equipment {
44
_id: string;
55
name: string;
6-
domain: string;
6+
domain: Domain;
77
longitude: string;
88
latitude: string;
99
serial: string;
@@ -13,9 +13,23 @@ export interface Equipment {
1313
createdAt?: Date;
1414
updatedAt?: Date;
1515
created_by?: CreatedBy;
16+
history?: EquipmentHistory[];
17+
}
18+
19+
export interface EquipmentHistory {
20+
userId: string;
21+
userName: string;
22+
isActive: boolean;
23+
status: string;
24+
date: string;
1625
}
1726

1827
interface CreatedBy {
1928
id: string;
2029
name: string;
2130
}
31+
32+
interface Domain {
33+
_id: string;
34+
name: string;
35+
}

src/helpers/models/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {Equipment} from './equipment';
1+
import {Equipment, EquipmentHistory} from './equipment';
22
import {Files} from './files';
33
import {User} from './user';
44
import {Domain} from './domain';
55

6-
export type {Equipment, Files, User, Domain};
6+
export type {Equipment, Files, User, Domain, EquipmentHistory};

src/helpers/validators/equipmentValidator.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class EquipmentValidator {
44
public validateEquipment(equipment: Equipment): string | null {
55
let validation = null;
66
if (!this.validateEmptyString(equipment.name)) validation = 'name';
7-
if (!this.validateEmptyString(equipment.domain))
7+
if (!this.validateEmptyString(equipment.domain._id))
88
validation = validation ? validation + 'domain' : 'domain';
99
if (!this.validateEmptyString(equipment.serial))
1010
validation = validation ? validation + 'serial' : 'serial';
@@ -46,7 +46,10 @@ class EquipmentValidator {
4646
}
4747

4848
const defaultEquipment: Equipment = {
49-
domain: '',
49+
domain: {
50+
_id: '',
51+
name: '',
52+
},
5053
files: undefined,
5154
latitude: '',
5255
longitude: '',

src/modules/components/base/codeInput.tsx

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
1-
import React, {useRef, useState} from 'react';
2-
import {View, TextInput, StyleSheet, KeyboardTypeOptions} from 'react-native';
1+
import React from 'react';
2+
import {View, TextInput, StyleSheet} from 'react-native';
33

44
interface props {
55
label?: string;
66
placeholder?: string;
7-
keyboardType?: KeyboardTypeOptions;
8-
maxLength?: number;
9-
onChangeText?: (text: string) => void;
10-
value?: any;
7+
onChangeText: (codes: any[]) => void;
8+
value: any;
119
inputStyle?: any;
1210
labelStyle?: any;
1311
onBlur?: () => void;
1412
}
1513

16-
function CodeInput({onChangeText, inputStyle}: props) {
17-
const [code, setCode] = useState(['', '', '', '', '', '']);
14+
function CodeInput({value, onChangeText, inputStyle}: props) {
15+
const handleCodeChange = (text, index) => {
16+
if (/^\d*$/.test(text) && text.length <= 1) {
17+
const newCode = [...value];
18+
newCode[index] = text;
19+
onChangeText(newCode);
1820

19-
const handleCodeChange = (text, index) => {
20-
if (/^\d*$/.test(text) && text.length <= 1) {
21-
const newCode = [...code];
22-
newCode[index] = text;
23-
setCode(newCode);
24-
25-
if (text !== '') {
26-
focusNextInput(index + 1);
27-
} else{
28-
focusPreviousInput(index - 1);
29-
}
21+
if (text !== '') {
22+
focusNextInput(index + 1);
23+
} else {
24+
focusPreviousInput(index - 1);
3025
}
31-
};
26+
}
27+
};
3228

33-
const focusNextInput = nextIndex => {
34-
if (nextIndex < 6) {
35-
this[`inputRef${nextIndex}`].focus();
36-
}
37-
};
29+
const focusNextInput = nextIndex => {
30+
if (nextIndex < 6) {
31+
this[`inputRef${nextIndex}`].focus();
32+
}
33+
};
34+
35+
const focusPreviousInput = prevIndex => {
36+
if (prevIndex >= 0) {
37+
this[`inputRef${prevIndex}`].focus();
38+
}
39+
};
3840

39-
const focusPreviousInput = prevIndex => {
40-
if (prevIndex >= 0) {
41-
this[`inputRef${prevIndex}`].focus();
42-
}
43-
};
44-
4541
return (
4642
<View style={styles.container}>
47-
{code.map((value, index) => (
43+
{value.map((value, index) => (
4844
<TextInput
4945
key={index}
5046
style={styles.input}

src/modules/components/base/dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const styles = StyleSheet.create({
154154
},
155155
list: {
156156
width: 150,
157-
height: 100,
157+
height: 135,
158158
marginTop: 18,
159159
paddingVertical: 4,
160160
backgroundColor: '#444',

src/modules/components/domain/search-domain.tsx renamed to src/modules/components/base/search-bar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import Icon from 'react-native-vector-icons/FontAwesome5';
55

66
interface Props {
77
value: string;
8+
newItemPage: string;
89
onChangeText: (text: React.SetStateAction<string>) => void;
910
}
1011

11-
const SearchDomain = ({value, onChangeText}: Props) => {
12+
const SearchBar = ({value, newItemPage, onChangeText}: Props) => {
1213
return (
1314
<View style={styles.container}>
1415
<View style={styles.searchContainer}>
@@ -24,7 +25,7 @@ const SearchDomain = ({value, onChangeText}: Props) => {
2425

2526
<Pressable
2627
style={styles.addIconContainer}
27-
onPress={() => navigate('RegisterDomain')}>
28+
onPress={() => navigate(newItemPage)}>
2829
<Icon style={styles.addIcon} name="plus-circle" />
2930
</Pressable>
3031
</View>
@@ -77,4 +78,4 @@ const styles = StyleSheet.create({
7778
},
7879
});
7980

80-
export default SearchDomain;
81+
export default SearchBar;
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React from 'react';
2+
import {StyleSheet, Text, View, ListRenderItem} from 'react-native';
3+
import {EquipmentHistory} from '../../../helpers/models';
4+
5+
const EquipmentHistoryComponent: ListRenderItem<EquipmentHistory> = ({
6+
item,
7+
}) => {
8+
return (
9+
<View style={styles.equipment}>
10+
<View>
11+
<Text style={styles.serial}>
12+
<Text style={{fontWeight: 'bold'}}>Data e Hora: {item.date}</Text>
13+
</Text>
14+
<Text style={styles.serial}>
15+
<Text style={{fontWeight: 'bold'}}>Estado: {item.status}</Text>
16+
</Text>
17+
<Text style={styles.serial}>
18+
<Text style={{fontWeight: 'bold'}}>Editado por: {item.userName}</Text>
19+
</Text>
20+
</View>
21+
<Text
22+
style={[
23+
styles.status,
24+
item.isActive ? styles.activeStatus : styles.inactiveStatus,
25+
]}>
26+
{item.isActive}
27+
</Text>
28+
</View>
29+
);
30+
};
31+
32+
const styles = StyleSheet.create({
33+
equipment: {
34+
display: 'flex',
35+
flexDirection: 'row',
36+
maxWidth: '96%',
37+
borderRadius: 5,
38+
marginLeft: 6,
39+
marginTop: 4,
40+
backgroundColor: '#363636',
41+
paddingBottom: 5
42+
},
43+
serial: {
44+
marginLeft: 6,
45+
fontSize: 16,
46+
color: '#EEE',
47+
marginTop: 5,
48+
},
49+
status: {
50+
position: 'absolute',
51+
right: 5,
52+
top: 5,
53+
width: 16,
54+
borderRadius: 100,
55+
backgroundColor: 'blue',
56+
},
57+
activeStatus: {
58+
backgroundColor: '#90EE90', // Estilo para quando item.isActive for true
59+
},
60+
inactiveStatus: {
61+
backgroundColor: '#D2691E', // Estilo para quando item.isActive for false
62+
},
63+
});
64+
65+
export default EquipmentHistoryComponent;

0 commit comments

Comments
 (0)