Skip to content

Commit

Permalink
Merge pull request #71 from fga-eps-mds/151-gerar-relatorios-equipame…
Browse files Browse the repository at this point in the history
…nto-2

151 gerar relatorios equipamento 2
  • Loading branch information
JPedroCh authored Jul 10, 2023
2 parents 10cec89 + be83acf commit f04e623
Show file tree
Hide file tree
Showing 16 changed files with 7,839 additions and 445 deletions.
182 changes: 91 additions & 91 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
{
"name": "alectrion",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"start": "node server/app.js",
"dev": "vite",
"build": " rm -rf dist && tsc && vite build",
"preview": "vite preview --port 8080",
"test": "vitest",
"coverage": "vitest run --coverage",
"lint": "eslint ./",
"lint:fix": "yarn lint --fix",
"prepare": "husky install",
"lint-staged": "lint-staged"
},
"lint-staged": {
"*.ts": [
"yarn lint:fix"
],
"*.tsx": [
"yarn lint:fix"
]
},
"dependencies": {
"@chakra-ui/icons": "^2.0.19",
"@chakra-ui/react": "^2.4.6",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@react-pdf/renderer": "^3.1.11",
"@tanstack/react-query": "^4.3.9",
"@tanstack/react-query-devtools": "^4.3.9",
"axios": "^1.2.2",
"chakra-react-select": "^4.4.3",
"date-fns": "^2.30.0",
"express": "^4.18.2",
"express-history-api-fallback": "^2.2.1",
"express-static-gzip": "^2.1.7",
"formik": "^2.2.9",
"framer-motion": "^6",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.28",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-csv": "^2.2.2",
"react-datepicker": "^4.11.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.41.5",
"react-icons": "^4.8.0",
"react-input-mask": "^2.0.4",
"react-pdf": "^7.0.3",
"react-render-if-visible": "^2.1.1",
"react-router-dom": "^6.6.1",
"react-toastify": "^9.1.2",
"sass": "^1.57.1",
"vitest-sonar-reporter": "^0.4.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@types/react": "^18.0.26",
"@types/react-csv": "^1.1.3",
"@types/react-datepicker": "^4.8.0",
"@types/react-dom": "^18.0.9",
"@types/react-input-mask": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@vitejs/plugin-react-swc": "^3.0.0",
"@vitest/coverage-c8": "^0.27.0",
"eslint": "^8.2.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^8.0.3",
"intersection-observer": "^0.12.2",
"jsdom": "^22.1.0",
"lint-staged": "^13.1.0",
"prettier": "^2.8.1",
"typescript": "^4.9.3",
"vite": "^4.0.0",
"vite-plugin-compression": "^0.5.1",
"vite-tsconfig-paths": "^4.0.3",
"vitest": "^0.26.3",
"zlib": "^1.0.5"
}
"name": "alectrion",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"start": "node server/app.js",
"dev": "vite",
"build": " rm -rf dist && tsc && vite build",
"preview": "vite preview --port 8080",
"test": "vitest",
"coverage": "vitest run --coverage",
"lint": "eslint ./",
"lint:fix": "yarn lint --fix",
"prepare": "husky install",
"lint-staged": "lint-staged"
},
"lint-staged": {
"*.ts": [
"yarn lint:fix"
],
"*.tsx": [
"yarn lint:fix"
]
},
"dependencies": {
"@chakra-ui/icons": "^2.0.19",
"@chakra-ui/react": "^2.4.6",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@react-pdf/renderer": "^3.1.11",
"@tanstack/react-query": "^4.3.9",
"@tanstack/react-query-devtools": "^4.3.9",
"axios": "^1.2.2",
"chakra-react-select": "^4.4.3",
"date-fns": "^2.30.0",
"express": "^4.18.2",
"express-history-api-fallback": "^2.2.1",
"express-static-gzip": "^2.1.7",
"formik": "^2.2.9",
"framer-motion": "^6",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.28",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-csv": "^2.2.2",
"react-datepicker": "^4.11.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.41.5",
"react-icons": "^4.8.0",
"react-input-mask": "^2.0.4",
"react-pdf": "^7.0.3",
"react-render-if-visible": "^2.1.1",
"react-router-dom": "^6.6.1",
"react-toastify": "^9.1.2",
"sass": "^1.57.1",
"vitest-sonar-reporter": "^0.4.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@types/react": "^18.0.26",
"@types/react-csv": "^1.1.3",
"@types/react-datepicker": "^4.8.0",
"@types/react-dom": "^18.0.9",
"@types/react-input-mask": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@vitejs/plugin-react-swc": "^3.0.0",
"@vitest/coverage-c8": "^0.27.0",
"eslint": "^8.2.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^8.0.3",
"intersection-observer": "^0.12.2",
"jsdom": "^22.1.0",
"lint-staged": "^13.1.0",
"prettier": "^2.8.1",
"typescript": "^4.9.3",
"vite": "^4.0.0",
"vite-plugin-compression": "^0.5.1",
"vite-tsconfig-paths": "^4.0.3",
"vitest": "^0.26.3",
"zlib": "^1.0.5"
}
}
8 changes: 7 additions & 1 deletion src/components/equipment-edit-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ export default function EquipmentEditForm({
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}

// eslint-disable-next-line no-param-reassign
equip.acquisitionDate = new Date(
new Date(equip.acquisitionDate).setMinutes(
equip.acquisitionDate.getMinutes() +
equip.acquisitionDate.getTimezoneOffset()
)
);
const onSubmit = handleSubmit(async (formData) => {
try {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { vi } from 'vitest';
import EquipmentViewForm from '.';

const EQUIPMENT_EDIT_MOCK = {
equipment: 'aaa',
tippingNumber: 'tippingNumber',
serialNumber: 'serialNumber',
type: { id: '1', name: 'type' },
Expand Down
10 changes: 8 additions & 2 deletions src/components/equipment-view-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { NewControlledSelect } from '../form-fields/new-controlled-select';
import { Input } from '../form-fields/input';

export type ViewEquipFormValues = {
id: any;
id: string;
tippingNumber: string;
serialNumber: string;
type: { name: string };
Expand Down Expand Up @@ -74,7 +74,13 @@ export default function EquipmentViewForm({
useEffect(() => {
resetField('type');
}, [resetField]);

// eslint-disable-next-line no-param-reassign
equipment.acquisitionDate = new Date(
new Date(equipment.acquisitionDate).setMinutes(
equipment.acquisitionDate.getMinutes() +
equipment.acquisitionDate.getTimezoneOffset()
)
);
const handleDelete = async () => {
try {
const response = await api.delete('equipment/deleteEquipment', {
Expand Down
1 change: 1 addition & 0 deletions src/components/movement-form/movement-form.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { vi } from 'vitest';
import MovementForm from '.';

const SELECTED_EQUIPMENT_MOCK = {
equipment: 'aaa',
tippingNumber: 'tippingNumber',
serialNumber: 'serialNumber',
type: { id: '1', name: 'type' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import OrderServiceEditForm from '.';

const ORDER_SERVICE_MOCK = {
equipment: {
equipment: 'aaa',
tippingNumber: 'tippingNumber',
serialNumber: 'serialNumber',
type: { id: '1', name: 'type' },
Expand Down
Loading

0 comments on commit f04e623

Please sign in to comment.