Skip to content

Commit 225604b

Browse files
authored
Merge pull request #566 from Black-Dot-2024/staging
Staging
2 parents 8180c8c + 0e2c361 commit 225604b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2967
-3425
lines changed

.github/ISSUE_TEMPLATE/issue-de-defecto.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
---
22
name: Issue de Defecto
33
about: Registrar un defecto encontrado
4-
title: Modulo/RFXX/Detalle
4+
title: MOD-RF00-ID00/Eliminar tarea cuando se elimina usario
55
labels: ''
66
assignees: ''
77
---
88

9-
# Contenido
10-
11-
## Test ID
12-
139
## Descripción de la tarea
1410

1511
¿Qué esta mal?

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ dist-ssr
3030
.env.*
3131

3232
*.http
33-
.vercel
33+
.vercel

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
"dev": "vite",
88
"build": "vite build",
99
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings=1000",
10-
"start": "vite preview",
10+
"start": "vite preview --port 3000",
1111
"test": "mocha -r ts-node/register 'src/**/*.spec.ts'",
1212
"prepare": "husky install"
1313
},
1414
"dependencies": {
1515
"@emotion/react": "^11.11.4",
1616
"@emotion/styled": "^11.11.0",
17+
"@lottiefiles/react-lottie-player": "^3.5.3",
1718
"@mui/icons-material": "^5.15.15",
1819
"@mui/joy": "5.0.0-beta.30",
1920
"@mui/material": "^5.15.15",

pnpm-lock.yaml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Snackbar } from '@mui/joy';
22
import { LocalizationProvider } from '@mui/x-date-pickers';
33
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
4+
import 'dayjs/locale/es-mx';
45
import { useEffect, useState } from 'react';
56
import { Outlet, Route, BrowserRouter as Router, Routes } from 'react-router-dom';
67
import Layout from './components/common/Layout';
@@ -9,6 +10,7 @@ import OfflineModal from './components/common/OfflineModal';
910
import ProtectedRoute from './components/common/ProtectedRoute';
1011
import { EmployeeBodyType, EmployeeContext } from './hooks/employeeContext';
1112
import { SnackbarContext, SnackbarState } from './hooks/snackbarContext';
13+
import { configDayjs } from './lib/dayjs/dayjs';
1214
import Auth from './pages/Auth';
1315
import Clients from './pages/Clients';
1416
import Employees from './pages/Employees';
@@ -18,6 +20,8 @@ import Tasks from './pages/Tasks';
1820
import { RoutesPath } from './utils/constants';
1921

2022
function App() {
23+
configDayjs();
24+
2125
const [state, setState] = useState<SnackbarState>({ open: false, message: '' });
2226
const [employee, setEmployee] = useState<EmployeeBodyType | null>(null);
2327

@@ -42,7 +46,7 @@ function App() {
4246

4347
return (
4448
<EmployeeContext.Provider value={{ employee, setEmployee }}>
45-
<LocalizationProvider dateAdapter={AdapterDayjs}>
49+
<LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale='es-mx'>
4650
<SnackbarContext.Provider value={{ state, setState }}>
4751
<OfflineModal />
4852
<Router>

src/components/common/ClientCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const ClientCard = ({
3333
{name}
3434
</span>
3535
</header>
36-
<div className='grid grid-cols-2 gap-2 flex-wrap'>
36+
<div className='grid grid-cols-2 gap-2'>
3737
<Chip
3838
sx={{
3939
bgcolor: colors.orangeChip,
@@ -46,7 +46,6 @@ const ClientCard = ({
4646
sx={{
4747
bgcolor: colors.orangeChip,
4848
fontSize: '13px',
49-
width: 'max-content',
5049
overflow: 'hidden',
5150
textOverflow: 'ellipsis',
5251
whiteSpace: 'nowrap',
@@ -58,7 +57,6 @@ const ClientCard = ({
5857
sx={{
5958
bgcolor: colors.brownChip,
6059
fontSize: '13px',
61-
width: 'max-content',
6260
overflow: 'hidden',
6361
textOverflow: 'ellipsis',
6462
whiteSpace: 'nowrap',
@@ -72,7 +70,6 @@ const ClientCard = ({
7270
color: '#0B6BCB',
7371
border: '1px solid #97C3F0',
7472
fontSize: '13px',
75-
width: 'max-content',
7673
overflow: 'hidden',
7774
textOverflow: 'ellipsis',
7875
whiteSpace: 'nowrap',

src/components/common/ColorChip.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ interface ColorChipProps {
77

88
function ColorChip(props: ColorChipProps) {
99
return (
10-
<Chip style={{ backgroundColor: props.color, color: 'black', fontSize: '1rem' }}>
10+
<Chip
11+
style={{ backgroundColor: props.color, color: 'black', fontSize: '1rem', maxWidth: '100%' }}
12+
>
1113
{props.label}
1214
</Chip>
1315
);

src/components/common/CustomSelect.tsx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
import { Option, Select } from '@mui/joy';
2-
import { FormState } from '../../hooks/useNewProject';
2+
import { FormState, FormStateTypes } from '../../hooks/useProjectForm';
33

4-
interface CustomSelectProps {
5-
values: string[];
6-
handleChange: (field: keyof FormState, value: string | Date | boolean | null) => void;
4+
type CustomSelectProps = {
5+
options: string[];
6+
value: string;
7+
values?: string[];
8+
handleChange: (field: keyof FormState, value: FormStateTypes) => void;
79
name: keyof FormState;
810
defaultValue?: string;
9-
}
11+
disabled?: boolean;
12+
};
13+
14+
const CustomSelect = ({
15+
options,
16+
values,
17+
handleChange,
18+
name,
19+
value,
20+
disabled = false,
21+
}: CustomSelectProps) => {
22+
function onChange(_: React.SyntheticEvent | null, newVal: string | null) {
23+
handleChange(name, newVal);
24+
}
25+
26+
const valuesSet = values ?? options;
1027

11-
const CustomSelect = ({ values, handleChange, name, defaultValue = '' }: CustomSelectProps) => {
1228
return (
13-
<Select defaultValue={defaultValue} onChange={(_, newVal) => handleChange(name, newVal ?? '')}>
14-
{values.map(value => {
29+
<Select value={value} onChange={onChange} disabled={disabled}>
30+
{options.map((option, i) => {
1531
return (
16-
<Option key={value} value={value}>
17-
{value}
32+
<Option key={i} value={valuesSet[i]}>
33+
{option}
1834
</Option>
1935
);
2036
})}

src/components/common/DeleteModal.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Sheet from '@mui/joy/Sheet';
88
import Typography from '@mui/joy/Typography';
99
import * as React from 'react';
1010
import Colors from '../../colors';
11-
import useDeleteEmployee from '../../hooks/useDeleteEmployee';
1211

1312
interface ModalInterface {
1413
open: boolean;
@@ -17,7 +16,7 @@ interface ModalInterface {
1716
id: string;
1817
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
1918
toggleModal?: () => void;
20-
handleDeleteEmployee: (id: string) => void;
19+
handleDelete: (id: string) => void;
2120
}
2221

2322
export default function DeleteModal({
@@ -26,14 +25,11 @@ export default function DeleteModal({
2625
title,
2726
description,
2827
id,
29-
handleDeleteEmployee,
28+
handleDelete,
3029
}: ModalInterface) {
31-
const useDeleteEmployees = useDeleteEmployee();
32-
33-
const handleDelete = () => {
34-
useDeleteEmployees.deleteEmployee(id);
30+
const handleOnDelete = () => {
3531
setOpen(false); // This will close the modal or dialog
36-
handleDeleteEmployee(id); // This will update the UI
32+
handleDelete(id); // This will update the UI
3733
};
3834

3935
return (
@@ -97,7 +93,7 @@ export default function DeleteModal({
9793
backgroundColor: Colors.darkerGold,
9894
},
9995
}}
100-
onClick={() => handleDelete()}
96+
onClick={() => handleOnDelete()}
10197
>
10298
Delete
10399
</Button>

src/components/common/Error.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Typography } from '@mui/joy';
2-
import { colors } from '@mui/material';
1+
import { Typography, colors } from '@mui/joy';
32

43
interface ErrorViewProps<T> {
54
error: T;

0 commit comments

Comments
 (0)