Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
M
mydressin-front
Gestion
Activité
Membres
Labels
Programmation
Tickets
0
Tableaux des tickets
Jalons
Wiki
Jira
Code
Requêtes de fusion
2
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Service d'assistance
Analyse
Données d'analyse des chaînes de valeur
Contributor analytics
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
mydressin
mydressin-front
Validations
cde7de9e
Valider
cde7de9e
rédigé
il y a 3 mois
par
anas elhaddad
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
add conditional component
parent
8b19ad7a
Branches
Branches contenant la validation
1 requête de fusion
!497
MS-81/add loading to export buttons
Pipeline
#15925
réussi avec l'étape
in 4 minutes et 38 secondes
Modifications
2
Pipelines
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/shared/components/ConditionalComponent.tsx
+14
-0
14 ajouts, 0 suppression
src/shared/components/ConditionalComponent.tsx
src/shared/sections/order/view/order-list-view.tsx
+34
-22
34 ajouts, 22 suppressions
src/shared/sections/order/view/order-list-view.tsx
avec
48 ajouts
et
22 suppressions
src/shared/components/ConditionalComponent.tsx
0 → 100644
+
14
−
0
Voir le fichier @
cde7de9e
import
{
Fragment
}
from
"
react
"
;
type
PropsType
=
{
isValid
:
boolean
;
defaultComponent
?:
React
.
ReactNode
|
JSX
.
Element
;
children
:
React
.
ReactNode
|
JSX
.
Element
;
}
export
default
function
ConditionalComponent
({
isValid
,
defaultComponent
,
children
}:
PropsType
):
JSX
.
Element
{
return
(
<
Fragment
>
{
isValid
?
children
:
defaultComponent
||
null
}
</
Fragment
>
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/shared/sections/order/view/order-list-view.tsx
+
34
−
22
Voir le fichier @
cde7de9e
...
...
@@ -26,6 +26,7 @@ import { Alert, CircularProgress, Grid, Snackbar, TableCell, TableRow } from "@m
import
{
exportOrders
,
exportOrdersProducts
,
updateOrderStatus
,
useDeleteOrder
,
useDeleteOrderList
,
useOrderStatusCounts
,
useSearchOrders
}
from
"
@/shared/api/main-order
"
;
import
{
OrderStatus
,
orderStatusLabels
,
OrderStatusList
,
OrderWithClientDetails
,
}
from
"
@/contexts/types/main-order
"
;
import
{
getlastOrderHistory
}
from
"
@/shared/api/order
"
;
import
ConditionalComponent
from
"
@/shared/components/ConditionalComponent
"
;
interface
IOrderStatusOption
{
value
:
string
;
...
...
@@ -426,38 +427,49 @@ export default function OrderListView() {
</
Button
>
}
/>
<
Grid
container
justifyContent
=
"flex-end"
style
=
{
{
marginBottom
:
"
16px
"
}
}
>
<
Button
<
Grid
container
justifyContent
=
"flex-end"
sx
=
{
{
mb
:
2
}
}
>
<
ConditionalComponent
isValid
=
{
!
loadingExportOrder
}
defaultComponent
=
{
<
Button
variant
=
"contained"
disabled
sx
=
{
{
mr
:
1
}
}
>
<
CircularProgress
size
=
{
24
}
sx
=
{
{
color
:
"
white
"
}
}
/>
</
Button
>
}
>
<
Button
variant
=
"contained"
onClick
=
{
downloadOrdersCSV
}
style
=
{
{
marginRight
:
"
8px
"
}
}
disabled
=
{
loading
}
sx
=
{
{
mr
:
1
}
}
>
{
loadingExportOrder
?
(
<
CircularProgress
size
=
{
24
}
style
=
{
{
color
:
"
white
"
}
}
/>
)
:
(
"
Exporter les commandes
"
)
}
Exporter les commandes
</
Button
>
<
Button
</
ConditionalComponent
>
<
ConditionalComponent
isValid
=
{
!
loadingExportProduct
}
defaultComponent
=
{
<
Button
variant
=
"contained"
disabled
>
<
CircularProgress
size
=
{
24
}
sx
=
{
{
color
:
"
white
"
}
}
/>
</
Button
>
}
>
<
Button
variant
=
"contained"
onClick
=
{
downloadProductsCSV
}
disabled
=
{
loading
}
>
{
loadingExportProduct
?
(
<
CircularProgress
size
=
{
24
}
style
=
{
{
color
:
"
white
"
}
}
/>
)
:
(
"
Exporter les produits
"
)
}
Exporter les produits
</
Button
>
</
ConditionalComponent
>
</
Grid
>
<
Card
>
<
Tabs
...
...
This diff is collapsed.
Click to expand it.
Aperçu
0%
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter