Skip to content

Commit

Permalink
OSS => Premium
Browse files Browse the repository at this point in the history
commit 2dc074a
Author: Paul Maillardet <paul@pulsanova.com>
Date:   Tue Jan 5 11:47:59 2021 +0100

    Ajoute des onglets dans la vue du matériel en détail (#82)

    * Ajoute des onglets dans la vue du matériel en détail

    * Renomme le Dotfile de développement

    * Supprime l'affichage des unités dans la vue d'un matériel

    Co-authored-by: Donovan Lambert <donovan@pulsanova.com>

commit 27e467d
Merge: d318c40 0b8c817
Author: Paul Maillardet <paul@pulsanova.com>
Date:   Mon Jan 4 21:37:03 2021 +0100

    Merge pull request #80 from Robert-2/feature/material-view

    Ajoute la vue d'un matériel

commit 0b8c817
Author: Paul Maillardet <paul@pulsanova.com>
Date:   Sun Jan 3 22:27:42 2021 +0100

    Corrige selon review

commit 33cdf3d
Author: Paul Maillardet <paul@pulsanova.com>
Date:   Thu Dec 31 02:42:06 2020 +0100

    Ajoute la vue d'un matériel

commit d318c40
Merge: 985126a 3053393
Author: Paul Maillardet <paul@pulsanova.com>
Date:   Sat Jan 2 23:18:58 2021 +0100

    Merge pull request #81 from Robert-2/feature/improves-validation-2

    Améliore (encore) la validation

commit 3053393
Author: Donovan Lambert <donovan@pulsanova.com>
Date:   Fri Jan 1 16:35:37 2021 +0100

    Corrige les tests unitaires vu la nouvelle année (2021)

commit 37149e4
Author: Donovan Lambert <donovan@pulsanova.com>
Date:   Fri Jan 1 16:14:05 2021 +0100

    Améliore (encore) la validation

commit 985126a
Merge: acbb5cf de0bcb8
Author: Paul Maillardet <paul@pulsanova.com>
Date:   Wed Dec 30 14:04:04 2020 +0100

    Merge pull request #79 from Robert-2/feature/remove-partial-validation

    Améliore la validation des modèles

commit de0bcb8
Author: Donovan Lambert <donovan@pulsanova.com>
Date:   Wed Dec 30 12:25:45 2020 +0100

    Corrige la validation des modèles

commit 57993a9
Author: Donovan Lambert <donovan@pulsanova.com>
Date:   Tue Dec 29 18:56:47 2020 +0100

    Amélioration des booléens dans les fixtures

commit acbb5cf
Author: Donovan <donovan@pulsanova.com>
Date:   Tue Dec 29 17:27:42 2020 +0100

    Améliore la validation (+ Refactoring modèles) (#76)

commit f0bbab2
Author: Donovan <donovan@pulsanova.com>
Date:   Tue Dec 29 11:25:22 2020 +0100

    Ajuste la contrainte des unités de matériel dans les événements (#77)

    (Sera rollback lorsque l'on prendra en charge les guards lors du switch-back Gestion unitaire => Gestion non unitaire)
  • Loading branch information
Donov4n committed Jan 5, 2021
1 parent d32a0ee commit f96154d
Show file tree
Hide file tree
Showing 24 changed files with 479 additions and 34 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Ce projet adhère au principe du [Semantic Versioning](https://semver.org/spec/v
(Un lien symbolique est utilisé côté serveur pour relier les deux côtés de l'application)
- Corrige l'hôte de développement et permet sa customisation via une variable d'environnement.
- Améliorations internes de la validation des données.
- Ajoute une page de vue du matériel en détail.
- Utilise des onglets dans la page de vue du matériel.

## 0.10.2 (2020-11-16)

Expand Down
15 changes: 15 additions & 0 deletions client/src/components/MaterialTags/MaterialTags.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.MaterialTags {
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 0;
margin: 0;

&__item {
list-style: none;
padding: .3rem .5rem;
margin: 0 .35rem .35rem 0;
background: $bg-color-emphasis;
border-radius: 10px;
}
}
26 changes: 26 additions & 0 deletions client/src/components/MaterialTags/MaterialTags.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<ul class="MaterialTags">
<li
v-for="tag in tags"
:key="tag.id"
class="MaterialTags__item"
>
<i class="fas fa-tag" />
{{ tag.name }}
</li>
</ul>
</template>

<style lang="scss">
@import '../../themes/default/index';
@import './MaterialTags';
</style>

<script>
export default {
name: 'MaterialTags',
props: {
tags: Array,
},
};
</script>
9 changes: 9 additions & 0 deletions client/src/locale/en/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {

'action-add': "Add",
'action-edit': "Edit",
'action-view': "Display details",
'action-trash': "Trash bin",
'action-restore': "Restore",
'action-delete': "Delete",
Expand Down Expand Up @@ -78,21 +79,28 @@ export default {
'ref': "Ref.",
'reference': "Reference",
'park': "Park",
'prices': "Prices",
'rental-price': "Rental price",
'replacement-price': "Replacement price",
'rent-price': "Rent. price",
'repl-price': "Repl. price",
'value-per-day': '{value}\u00a0/\u00a0day',
'serial-number': "Serial n°",
'quantity': "Stock qty",
'quantities': "Quantities",
'quantity-out-of-order': "Out of order qty",
'discountable': "Discountable?",
'material-is-discountable': "The material is «\u0a00discountable\u00a0»: a discount amount can be applied to this material.",
'hidden-on-bill': "Hidden on bill?",
'material-not-displayed-on-bill': "The material is not displayed on bills.",
'price-must-be-zero': "the rental price must be 0",
'all-parks': "All parks combined",
'all-categories': "All categories",
'all-sub-categories': "All sub-categories",
'open-trash-bin': "Display trash bin",
'display-not-deleted-items': "Display not deleted items",
'created-at': "Created at:",
'updated-at': "Updated at:",

'event-details': "Event's details",
'title': "Title",
Expand Down Expand Up @@ -147,6 +155,7 @@ export default {
"{count} items",
],
'stock-items-count': "{count} in stock",
'out-of-order-items-count': "{count} out of order",
'sub-total': "Sub-total",
'total-amount': "Total amount",
'total-amount-with-discount': "Total with discount",
Expand Down
1 change: 1 addition & 0 deletions client/src/locale/en/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export default {
'add': "New material",
'edit': "Modify material «\u00a0{pageSubTitle}\u00a0»",
'help-edit': "Give a short name, and use the description field to detail the material if needed.",
'view': "Details of material «\u00a0{pageSubTitle}\u00a0»",
'confirm-delete': "Move this material in trash bin?",
'confirm-permanently-delete': "Do you really want to permanently delete this material?",
'confirm-restore': "Do you really want to restore this material?",
Expand Down
9 changes: 9 additions & 0 deletions client/src/locale/fr/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {

'action-add': "Ajouter",
'action-edit': "Modifier",
'action-view': "Afficher en détail",
'action-trash': "Corbeille",
'action-restore': "Restaurer",
'action-delete': "Supprimer",
Expand Down Expand Up @@ -78,21 +79,28 @@ export default {
'ref': "Réf.",
'reference': "Référence",
'park': "Parc",
'prices': "Tarifs",
'rental-price': "Tarif location",
'replacement-price': "Prix de remplacement",
'rent-price': "Tarif loc.",
'repl-price': "Val. rempl.",
'value-per-day': '{value}\u00a0/\u00a0jour',
'serial-number': "N° de série",
'quantity': "Qté stock",
'quantities': "Quantités",
'quantity-out-of-order': "Qté en panne",
'discountable': "Remisable\u00a0?",
'material-is-discountable': "Le matériel est «\u00a0remisable\u00a0»\u00a0: une remise peut être appliquée sur ce matériel.",
'hidden-on-bill': "Caché sur la facture\u00a0?",
'material-not-displayed-on-bill': "Le matériel n'est pas affiché sur les factures.",
'price-must-be-zero': "le tarif de location doit être égal à 0",
'all-parks': "Tous parcs confondus",
'all-categories': "Toutes catégories",
'all-sub-categories': "Toutes sous-catégories",
'open-trash-bin': "Afficher la corbeille",
'display-not-deleted-items': "Afficher les enregistrements non supprimés",
'created-at': "Créé le\u00a0:",
'updated-at': "Modifié le\u00a0:",

'event-details': "Détails de l'événement",
'title': "Titre",
Expand Down Expand Up @@ -147,6 +155,7 @@ export default {
"{count} articles",
],
'stock-items-count': "{count} en stock",
'out-of-order-items-count': "{count} en panne",
'sub-total': "Sous-total",
'total-amount': "Montant total",
'total-amount-with-discount': "Total après remise",
Expand Down
1 change: 1 addition & 0 deletions client/src/locale/fr/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export default {
'add': "Nouveau matériel",
'edit': "Modifier le matériel «\u00a0{pageSubTitle}\u00a0»",
'help-edit': "Trouvez un nom assez court, et utilisez plutôt la description pour détailler le matériel si besoin.",
'view': "Détails du matériel «\u00a0{pageSubTitle}\u00a0»",
'confirm-delete': "Mettre ce matériel à la corbeille\u00a0?",
'confirm-permanently-delete': "Voulez-vous vraiment supprimer définitivement ce matériel\u00a0?",
'confirm-restore': "Voulez-vous vraiment restaurer ce matériel\u00a0?",
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Material/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default {
this.setMaterialData(data);

setTimeout(() => {
this.$router.push('/materials');
this.$router.push(`/materials/${data.id}/view`);
}, 300);
})
.catch(this.displayError);
Expand Down
11 changes: 11 additions & 0 deletions client/src/pages/MaterialView/Infos/Attributes/Attributes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.MaterialViewInfosAttributes {
&__list {
&__item {
margin-bottom: .3rem;

&__value {
font-weight: 700;
}
}
}
}
44 changes: 44 additions & 0 deletions client/src/pages/MaterialView/Infos/Attributes/Attributes.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<template>
<div class="MaterialViewInfosAttributes">
<h3>{{ $t('special-attributes') }}</h3>
<ul
class="MaterialViewInfosAttributes__list"
v-if="attributes.length > 0"
>
<li
class="MaterialViewInfosAttributes__list__item"
v-for="attribute in attributes"
:key="attribute.id"
>
{{ attribute.name }}:
<span
v-if="attribute.type !== 'boolean'"
class="MaterialViewInfosAttributes__list__item__value"
>
{{ attribute.value }}
{{ attribute.unit }}
</span>
<span
v-if="attribute.type === 'boolean'"
class="MaterialViewInfosAttributes__list__item__value"
>
{{ attribute.value ? $t('yes') : $t('no') }}
</span>
</li>
</ul>
</div>
</template>

<style lang="scss">
@import '../../../../themes/default/index';
@import './Attributes';
</style>

<script>
export default {
name: 'MaterialViewInfosAttributes',
props: {
attributes: { required: true, type: Array },
},
};
</script>
35 changes: 35 additions & 0 deletions client/src/pages/MaterialView/Infos/Infos.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.MaterialViewInfos {
display: flex;
flex-wrap: wrap;

&__main {
flex: 2;
min-width: 250px;
margin-right: 3rem;
}

&__extras {
flex: 1;
min-width: 250px;
padding: 1rem 0 0;
}

&__rental-price,
&__stock-quantity {
font-weight: 700;
margin-bottom: .3rem;
}

&__out-of-order {
color: $text-danger-color;
}

&__categories {
margin: 1.5rem 0;
}

&__dates {
color: $text-light-color;
margin-top: 1.5rem;
}
}
93 changes: 93 additions & 0 deletions client/src/pages/MaterialView/Infos/Infos.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<template>
<div class="MaterialViewInfos">
<section class="MaterialViewInfos__main">
<h2>
{{ material.reference }}
</h2>
<h3>
<router-link :to="`/materials?${queryStringCategory}`">
{{ categoryName }}
</router-link>
<span v-if="subCategoryName">/</span>
<router-link
:to="`/materials?${queryStringSubCategory}`"
v-if="subCategoryName"
>
{{ subCategoryName }}
</router-link>
/
{{ material.name }}
</h3>
<p>{{ material.description }}</p>
<h3>{{ $t('quantities') }}</h3>
<ul>
<li class="MaterialViewInfos__stock-quantity">
{{ $t('stock-items-count', { count: material.stock_quantity || 0 }) }}
</li>
<li
v-if="material.out_of_order_quantity > 0"
class="MaterialViewInfos__out-of-order"
>
{{ $t('out-of-order-items-count', { count: material.out_of_order_quantity || 0 }) }}
</li>
</ul>
<div class="MaterialViewInfos__billing" v-if="showBilling">
<h3>{{ $t('prices') }}</h3>
<ul>
<li class="MaterialViewInfos__rental-price">
{{ $t('value-per-day', { value: rentalPrice }) }}
</li>
<li v-if="replacementPrice">
{{ $t('replacement-price') }} {{ replacementPrice }}
</li>
</ul>
<h3>{{ $t('billing') }}</h3>
<p v-if="material.is_hidden_on_bill">
{{ $t('material-not-displayed-on-bill') }}
</p>
<p v-if="material.is_discountable">
{{ $t('material-is-discountable') }}
</p>
</div>
<Attributes
v-if="material.attributes.length > 0"
:attributes="material.attributes"
/>
<div class="MaterialViewInfos__notes" v-if="material.note">
<h3>{{ $t('notes') }}</h3>
<p>{{ material.note }}</p>
</div>
</section>
<section class="MaterialViewInfos__extras">
<div class="MaterialViewInfos__actions">
<router-link
v-tooltip="$t('action-edit')"
:to="`/materials/${material.id}`"
tag="button"
class="info"
>
<i class="fas fa-edit" />
{{ $t('action-edit') }}
</router-link>
</div>
<div class="MaterialViewInfos__categories">
<p>{{ $t('category') }}: <strong>{{ categoryName }}</strong></p>
<p v-if="subCategoryName">
{{ $t('sub-category') }}: <strong>{{ subCategoryName }}</strong>
</p>
</div>
<MaterialTags :tags="material.tags" />
<div class="MaterialViewInfos__dates">
<p>{{ $t('created-at') }} {{ createDate }}</p>
<p>{{ $t('updated-at') }} {{ updateDate }}</p>
</div>
</section>
</div>
</template>

<style lang="scss">
@import '../../../themes/default/index';
@import './Infos';
</style>

<script src="./index.js"></script>
Loading

0 comments on commit f96154d

Please sign in to comment.