-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(card) : #MAG-114 add board cards #365
Open
FlorentMr
wants to merge
11
commits into
dev
Choose a base branch
from
MAG-527
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,058
−40
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b8d50ec
chore: prepare next development iteration
alicedraillard 5662022
chore: update edifice-ts-client version
alicedraillard b45887b
fix: remove useless property in pom.xml
benjaminperez 128eacd
WIP (trying to scale iframe)
bfbee77
WIP display board list selection
49d9264
wip
a5b41aa
feat(card) : #MAG-114 add board cards
694d761
linter prettier
91218cb
label and console fixes
e00d547
Pr returns
1d64a19
fix css
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 138 additions & 0 deletions
138
frontend/src/components/board-create-magnet-board-modal/BoardCreateMagnetBoardModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import { FC, useState } from "react"; | ||
|
||
import { Button, SearchBar } from "@edifice-ui/react"; | ||
import CloseIcon from "@mui/icons-material/Close"; | ||
import { Box, IconButton, Modal, Typography } from "@mui/material"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
import { | ||
closeButtonStyle, | ||
contentContainerStyle, | ||
duplicateButtonStyle, | ||
headerStyle, | ||
modalContainerStyle, | ||
modalFooterStyle, | ||
titleStyle, | ||
} from "./style"; | ||
import { InputValueState, BoardCreateMagnetBoardModalProps } from "./types"; | ||
import { useRenderContent } from "./useRenderContent"; | ||
import { initialInputvalue } from "./utils"; | ||
import { TabList } from "../tab-list/TabList"; | ||
import { CURRENTTAB_STATE } from "../tab-list/types"; | ||
import { BOARD_TABS_CONFIG } from "../tab-list/utils"; | ||
import { useMediaLibrary } from "~/providers/MediaLibraryProvider"; | ||
|
||
export const BoardCreateMagnetBoardModal: FC< | ||
BoardCreateMagnetBoardModalProps | ||
> = ({ open, onClose }) => { | ||
const [inputValue, setInputValue] = | ||
useState<InputValueState>(initialInputvalue); | ||
const { currentTab } = inputValue; | ||
const { t } = useTranslation("magneto"); | ||
const { setIsCreateMagnetOpen, setSelectedBoardData } = useMediaLibrary(); | ||
|
||
const handleTabChange = (newValue: CURRENTTAB_STATE) => { | ||
setInputValue((prevState) => ({ | ||
...prevState, | ||
currentTab: newValue, | ||
selectedBoardId: null, | ||
})); | ||
}; | ||
|
||
const handleSearchChange = (newValue: string) => { | ||
setInputValue((prevState) => ({ | ||
...prevState, | ||
search: newValue, | ||
selectedBoardId: null, | ||
})); | ||
}; | ||
|
||
const handleClose = () => { | ||
setInputValue(initialInputvalue); | ||
onClose(); | ||
}; | ||
|
||
const handleSubmit = async () => { | ||
if (inputValue.selectedBoardId) { | ||
setSelectedBoardData(inputValue.selectedBoardId); | ||
setIsCreateMagnetOpen(true); | ||
handleClose(); | ||
} | ||
}; | ||
|
||
return ( | ||
<Modal | ||
open={open} | ||
onClose={onClose} | ||
aria-labelledby="modal-title" | ||
aria-describedby="modal-create-magnet-magnet" | ||
> | ||
<Box sx={modalContainerStyle}> | ||
<Box sx={headerStyle}> | ||
<Typography | ||
id="modal-title" | ||
variant="h4" | ||
component="h2" | ||
sx={titleStyle} | ||
> | ||
{t("magneto.boards.collection")} | ||
</Typography> | ||
<IconButton | ||
onClick={onClose} | ||
aria-label="close" | ||
sx={closeButtonStyle} | ||
> | ||
<CloseIcon fontSize="inherit" /> | ||
</IconButton> | ||
</Box> | ||
<Box sx={{ width: "100%", padding: "2rem 10%", margin: "auto" }}> | ||
<SearchBar | ||
onChange={(e) => { | ||
handleSearchChange(e.target.value); | ||
}} | ||
placeholder={t("magneto.search.placeholder")} | ||
size="md" | ||
isVariant | ||
className="searchbar" | ||
/> | ||
</Box> | ||
<Box | ||
sx={{ | ||
width: "100%", | ||
pb: "1rem", | ||
margin: "auto", | ||
display: "flex", | ||
justifyContent: "center", | ||
}} | ||
> | ||
<TabList | ||
currentTab={currentTab} | ||
onChange={handleTabChange} | ||
tabsConfig={BOARD_TABS_CONFIG} | ||
/> | ||
</Box> | ||
<Box sx={contentContainerStyle}> | ||
{useRenderContent(inputValue, setInputValue)} | ||
</Box> | ||
<Box sx={modalFooterStyle}> | ||
<Box sx={duplicateButtonStyle}> | ||
<Button | ||
color="tertiary" | ||
type="button" | ||
variant="ghost" | ||
onClick={() => handleClose()} | ||
> | ||
{t("magneto.cancel")} | ||
</Button> | ||
<Button | ||
onClick={() => handleSubmit()} | ||
disabled={!inputValue.selectedBoardId} | ||
> | ||
{t("magneto.add")} | ||
</Button> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Modal> | ||
); | ||
}; |
73 changes: 73 additions & 0 deletions
73
frontend/src/components/board-create-magnet-board-modal/BoardList.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
ul.grid { | ||
padding-top: 1.5rem; | ||
padding-right: 1.6rem; | ||
display: grid; | ||
grid-template-columns: repeat( | ||
4, | ||
minmax(0, 1fr) | ||
); /* Force equal width columns */ | ||
gap: 1.6rem; | ||
width: 100% !important; | ||
} | ||
|
||
li.boardSizing { | ||
/* Remove any width constraints */ | ||
min-width: 0; | ||
|
||
.card { | ||
width: 100%; | ||
padding: unset !important; | ||
margin: unset !important; | ||
display: flex; | ||
flex-wrap: wrap !important; | ||
flex-direction: column; | ||
max-width: 100%; /* Ensure card doesn't overflow */ | ||
|
||
.board-number-magnets { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
svg { | ||
color: #ffb600; | ||
font-size: 1.4rem; | ||
} | ||
|
||
svg + p { | ||
font-size: 1.2rem; | ||
margin: 0; | ||
} | ||
} | ||
|
||
.board-about { | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
|
||
.board-about-left-content, | ||
.board-about-right-content { | ||
margin: 0 !important; | ||
display: flex; | ||
gap: 0.4rem; | ||
align-items: center; | ||
|
||
.med-resource-card-text { | ||
font-size: 1.2rem; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
.title { | ||
width: 100%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
font-size: 1.4rem; | ||
} | ||
|
||
.card-body { | ||
width: 100%; | ||
padding: 1.2rem; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t'as la MessageModal d'Alice qui embarque le plus gros du style de nos modales
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai repris BoardCreateMagnetMagnetModal qui a sa propre Modal aussi, je verrais pour factoriser avec MessageModal si il faut, mais c'était pour gagner du temps vu qu'elles sont relativement ressemblantes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai essayé de reprendre avec MessageModal, mais comme le style de container principal de la modal n'est pas le même (au niveau de la height et width notamment) l'affichage est tout cassé, ça va demander plus de travail, je vois au retour des vacances si ça prendra beaucoup de temps