Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evol/drawer #4

Open
wants to merge 22 commits into
base: evol/lists-and-filters
Choose a base branch
from
Open

Evol/drawer #4

wants to merge 22 commits into from

Conversation

lucas-amiaud
Copy link
Owner

No description provided.

background-color: #ffffff;
box-shadow: 0 3px 5px 1px rgba(#000000, .25);
background-color: #fff;
box-shadow: 0 3px 5px 1px rgba(#000, .25);
border-radius: 3px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T'as pas de variables pour les border-radius ?

return 'full';
}

return width < widthMediumScreen ? 60 : defaultSize;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return width < widthMediumScreen ? 60 : defaultSize;
return width < widthMediumScreen ? largeSize : defaultSize;

import PlumeAdminTheme from '../../../lib/plume-admin-theme/PlumeAdminTheme';

/**
* When a drawer is a all page, there is no state to control its opening / closing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is a whole page* ?
pas compris pourquoi il y aurait pas de state ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y a pas de state dans le parent pour controler l'ouverture / la fermeture. Donc c'est lui même qui gère son état d'ouverture / fermeture et le parent ne se charge de rien

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dans ce cas, le composant est mal nommé, c'est plutôt fullPageDrawer ou quelque chose dans le genre

<this.theme.actionButton
iconName="delete"
style={ActionStyle.DANGER}
onClick={confirmDeleteUser.handleConfirmation(() => tryDeleteUser(userId))}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dis moi si je me trompe, mais on passe une fonction ici, alors que dans tous les cas l'action "tryDeleteUser(userId)" est override dans la modale ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je comprends pas, pourquoi il serait override dans un composant générique ?

const [isDrawerOpened, toggleDrawerOpening] = useToggle(false);

const uncontrolledClose = () => {
toggleDrawerOpening();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toggleDrawer tout court non ? je trouve ça bizarre d'appler opening dans close

.save(userToSave)
.then((createdUser) => {
updateUsersAndRoles();
this.notificationEngine.addSuccess(this.messages.t('message.changes-saved'));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

si createdUser est undefined on veut pas de notif de succès non ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ca peut pas arriver, si la création se passe bien il sera renvoyé

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok du coup pas besoin du if juste en dessous

</this.theme.actionButton>
<this.theme.actionButton
style={ActionStyle.DANGER}
onClick={confirmDeleteUser.confirm(() => tryDeleteUser(userId))}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on peut pas renommer tryDeleteUser ? parce que chaque appel api au final c'est un peu un essai qui peut fail

border-radius: $border-radius-3;
padding: $spacer-6;
max-width: 600px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi ça ?

@@ -0,0 +1,9 @@
@use "../variables" as *;

:export{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne comprends pas bien à quoi sert ce fichier


export interface DrawerTypeProps extends CommonDrawerProps {
open: boolean,
close: () => void,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne comprends pas ces 2 propriétés.

import { DrawerTypeProps } from '../../../lib/plume-admin-theme/drawer/DrawerProps';
import ActionStyle from '../../../lib/plume-admin-theme/action/ActionStyle';

export default function Drawer(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Antoine LL Tu penses qu'on peut reprendre des choses du slider de la VEL ?

// Returns width percentage of drawer
const drawerSize = () => {
const defaultSize = 40;
const largeSize = 60;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A sortir de la fonction pour ne pas redéfinir les valeurs à chaque fois

title: string,
children: React.ReactNode,
size?: number | string,
sizedByWidth?: boolean,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qu'est ce que ça veut dire ?

import PlumeAdminTheme from '../../../lib/plume-admin-theme/PlumeAdminTheme';

/**
* When a drawer is a all page, there is no state to control its opening / closing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dans ce cas, le composant est mal nommé, c'est plutôt fullPageDrawer ou quelque chose dans le genre

return (
<NativeSelect
<TextField

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi TextField et pas Select ?

@@ -19,16 +21,19 @@ export function Popin({
}

export function PopinCloseWithoutSaving(
{ confirmCloseWithoutSaving, closeWithoutSavingAction }: PopinCloseWithoutSavingProps,
{ title, confirmCloseWithoutSaving, closeWithoutSavingAction }: PopinCloseWithoutSavingProps,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le titre doit être optionnel

};

export type PopinCloseWithoutSavingProps = {
title: string,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optionnel

lucas-amiaud pushed a commit that referenced this pull request Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants