Skip to content

Commit

Permalink
added fields
Browse files Browse the repository at this point in the history
  • Loading branch information
leopoldch committed Mar 14, 2024
1 parent 5d908c5 commit 5ae5ee2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions backend/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ class Item(models.Model):
('son', 'Son'),
('structure', 'Structure'),
('autre', 'Autre'),
('elec', 'Elec'),
('secu', 'Secu')
]
TYPES_CHOICES2 = [
('neuf', 'Neuf'),
('bien', 'Bien'),
('use', 'Usé'),
('reparable', 'Réparable'),
('casse', 'Cassé'),
Expand Down
4 changes: 4 additions & 0 deletions src/components/FormAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ const options1 = [
{ key: 'son', text: 'Son', value: 'son' },
{ key: 'autre', text: 'Autre', value: 'autre' },
{ key: 'structure', text: 'Structure', value: 'structure' },
{ key: 'elec', text: 'Elec', value: 'elec' },
{ key: 'secu', text: 'Secu', value: 'secu' },

];
const options2 = [
{ key: 'neuf', text: 'Neuf', value: 'neuf' },
{ key: 'bien', text: 'Bien', value: 'bien' },
{ key: 'use', text: 'Usé', value: 'use' },
{ key: 'reparable', text: 'Réparable', value: 'reparable' },
{ key: 'casse', text: 'Cassé', value: 'casse' },
Expand Down
4 changes: 4 additions & 0 deletions src/components/FormEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ const options = [
{ key: 'son', text: 'Son', value: 'son' },
{ key: 'autre', text: 'Autre', value: 'autre' },
{ key: 'structure', text: 'Structure', value: 'structure' },
{ key: 'elec', text: 'Elec', value: 'elec' },
{ key: 'secu', text: 'Secu', value: 'secu' },

];
const options2 = [
{ key: 'neuf', text: 'Neuf', value: 'neuf' },
{ key: 'bien', text: 'Bien', value: 'bien' },
{ key: 'use', text: 'Usé', value: 'use' },
{ key: 'reparable', text: 'Réparable', value: 'reparable' },
{ key: 'casse', text: 'Cassé', value: 'casse' },
Expand Down
3 changes: 3 additions & 0 deletions src/components/TableData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,15 @@ function convertDateFormat(isoDateString) {
{ key: 2, text: 'Son', value: 'son' },
{ key: 3, text: 'Structure', value: 'structure' },
{ key: 4, text: 'Autre', value: 'autre' },
{key : 5, text: 'Elec', value: 'elec'},
{key : 6, text: 'Secu', value: 'secu'}
];
const options2 = [
{ key: 1, text: 'Neuf', value: 'neuf' },
{ key: 2, text: 'Usé', value: 'use' },
{ key: 3, text: 'Réparable', value: 'reparable' },
{ key: 4, text: 'Cassé', value: 'casse' },
{ key: 5, text: 'Bien', value: 'bien' },
];

const handleCategoryChange = (e, { value }) => {
Expand Down
8 changes: 6 additions & 2 deletions src/components/TableSelectedItems.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function TableSelectedItems(props){
let items = props.tab;

const countItemsByType = (items) => {
const categories = ['light', 'son', 'structure', 'autre'];
const categories = ['light', 'son', 'structure', 'autre', 'elec', 'secu'];
const counts = {};

categories.forEach((category) => {
Expand Down Expand Up @@ -74,6 +74,8 @@ function TableSelectedItems(props){
<TableHeaderCell>Nombre de lights</TableHeaderCell>
<TableHeaderCell>Nombre de son</TableHeaderCell>
<TableHeaderCell>Nombre de structure</TableHeaderCell>
<TableHeaderCell>Nombre d'elec</TableHeaderCell>
<TableHeaderCell>Nombre de secu</TableHeaderCell>
<TableHeaderCell>Nombre autre</TableHeaderCell></>}

<TableHeaderCell>Puissance totale</TableHeaderCell>
Expand All @@ -83,12 +85,14 @@ function TableSelectedItems(props){

<TableBody>
<TableRow>
<TableCell>{itemCountByType.son+itemCountByType.structure+itemCountByType.light+itemCountByType.autre}</TableCell>
<TableCell>{itemCountByType.son+itemCountByType.structure+itemCountByType.light+itemCountByType.autre+itemCountByType.elec+itemCountByType.secu}</TableCell>
{isLargeScreen &&
<>
<TableCell>{itemCountByType.light}</TableCell>
<TableCell>{itemCountByType.son}</TableCell>
<TableCell>{itemCountByType.structure}</TableCell>
<TableCell>{itemCountByType.elec}</TableCell>
<TableCell>{itemCountByType.secu}</TableCell>
<TableCell>{itemCountByType.autre}</TableCell></>}
<TableCell>{totalPower}</TableCell>
<TableCell>{totalPrice}</TableCell>
Expand Down

0 comments on commit 5ae5ee2

Please sign in to comment.