This repository has been archived by the owner on May 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Share links carry only the group ids, not the full informations * chore(style): Tab indentation go brrrrr * fix(ui): Center footer on mobile * feat(ui): Added hint about hovers * feat(ui): Message when no result found * chore(deps): Upgraded to react-script 5.0.0 and nth-check * chore(deps): Move react-scripts to devDeps * feat: Basic share implementation with materialui * feat: Moved group selector to a basic modal * feat: Move Group Remover to SpeedDialAction + added backdrop * feat: New group selector modal (but app currently crashes due to change of group) * fix: New group model is working * tmp: Hardcode API url * fix: Removed unused variable * Use netlify `_rewrite` proxy (#3) Use the proxy provided by netflify to avoid CORS issues when calling the API. This will remove the need to use another proxy in front of the app. * feat: Allow to add global groups * feat: Go back in group selector modal * chore: Add husky config for pre-commit hook * cleaning: Remove compact feature * feat: Persistent labels and color on speedial actions * fix: Import with new logic * chore: Change app icon * chore: Reorganise and clean code * feat: better organisation of header bar * docs: updated netlify link on README.md * feat: settings moved to their own modal * feat: app bar for title * chore: removed unused import * fix: update phrasing to match new UI design * feat: keep previous choice in Group Selector
- Loading branch information
1 parent
efb233d
commit e3e5c50
Showing
44 changed files
with
7,157 additions
and
11,120 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint:fix | ||
npm run format:write |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
[[redirects]] | ||
from = "/api/v1/*" | ||
to = "https://sedna.univ-fcomte.fr/jsp/custom/ufc/:splat" | ||
status = 200 | ||
force = true # COMMENT: ensure that we always redirect |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,98 +1,58 @@ | ||
import queryString from "query-string"; | ||
import { React, useEffect, useState } from "react"; | ||
import ShareIcon from "@mui/icons-material/Share"; | ||
import Fab from "@mui/material/Fab"; | ||
import { React, useState } from "react"; | ||
import { QueryClientProvider } from "react-query"; | ||
import ReactTooltip from "react-tooltip"; | ||
|
||
import "./App.scss"; | ||
import DeleteGroups from "./components/GroupeSelector/DeleteGroups"; | ||
import GroupSelector from "./components/GroupeSelector/GroupSelector"; | ||
import ControlledCheckbox from "./components/miscellaneous/ControlledCheckbox"; | ||
import ControlledInput from "./components/miscellaneous/ControlledInput"; | ||
import Footer from "./components/miscellaneous/Footer"; | ||
import Title from "./components/miscellaneous/Title"; | ||
import HeaderBar from "./components/miscellaneous/HeaderBar"; | ||
import CompareSchedule from "./components/Schedule/CompareSchedule"; | ||
import ShareUrl from "./components/Share/ShareUrl"; | ||
import SettingsDialog from "./components/Setttings/SettingsDialog"; | ||
import LoadURLConfig from "./components/Share/LoadURLConfig"; | ||
import { shareGroupsUrl } from "./components/Share/share"; | ||
import queryClient from "./utils/queryClient"; | ||
import { useLocalStorage } from "./utils/useLocalStorage"; | ||
|
||
function App() { | ||
const [config, setConfig] = useLocalStorage("config", { isCompact: true, nbWeeks: 2 }); | ||
const [groups, setGroups] = useLocalStorage("saved-groups", {}); | ||
const [error, setError] = useState(); | ||
|
||
useEffect(() => { | ||
console.debug("test"); | ||
if (window.location.search !== "") { | ||
let newGroups; | ||
try { | ||
const { groups: JSONGroups } = queryString.parse(window.location.search); | ||
newGroups = JSON.parse(JSONGroups); | ||
localStorage.setItem("saved-groups", JSON.stringify(newGroups)); | ||
window.location.search = ""; | ||
} catch (error) { | ||
console.error(error, "groups:", newGroups); | ||
setError( | ||
"Impossible de charger les groupes depuis le lien, essaie en copiant-collant directement le lien dans ton navigateur, ou ajoute les groupes manuellement" | ||
); | ||
} | ||
} | ||
}, []); | ||
|
||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<header> | ||
<Title /> | ||
|
||
<div className="buttons"> | ||
<GroupSelector | ||
groupId={0} | ||
addGroup={(group) => { | ||
console.info("Adding group", group); | ||
setGroups((oldList) => ({ ...oldList, [group.id]: group.name })); | ||
if (error) { | ||
setError(false); | ||
} | ||
}} | ||
/> | ||
<hr /> | ||
<DeleteGroups groups={groups} setGroups={setGroups} /> | ||
<hr /> | ||
<ShareUrl groups={groups} /> | ||
|
||
<div id="config"> | ||
<ControlledCheckbox | ||
id="config-compact" | ||
value={config.isCompact} | ||
handleInput={(ev) => setConfig((old) => ({ ...old, isCompact: ev.target.checked }))} | ||
data-tip="Cache les heures libres dans tous les emplois du temps en début et en fin de journée" | ||
> | ||
<>Économiser de la place</> | ||
</ControlledCheckbox> | ||
<ControlledInput | ||
id="config-weeks" | ||
value={config.nbWeeks} | ||
handleInput={(ev) => | ||
setConfig((old) => ({ ...old, nbWeeks: parseInt(ev.target.value) })) | ||
} | ||
data-tip="Nombre de semaines à afficher dans la comparaison" | ||
> | ||
<>Nombre de semaines</> | ||
</ControlledInput> | ||
</div> | ||
|
||
{error && <pre className="error">{error}</pre>} | ||
</div> | ||
</header> | ||
|
||
<main> | ||
<CompareSchedule groups={groups} config={config} /> | ||
</main> | ||
|
||
<Footer /> | ||
|
||
<ReactTooltip multiline effect="solid" /> | ||
</QueryClientProvider> | ||
); | ||
const [config, setConfig] = useLocalStorage("config", { nbWeeks: 2 }); | ||
const [groups, setGroups] = useLocalStorage("saved-groups-v2", {}); | ||
|
||
const [isSettingsModalOpened, setIsSettingsModalOpened] = useState(false); | ||
|
||
const loadGroups = window.location.search !== ""; | ||
|
||
if (loadGroups) { | ||
return <LoadURLConfig originalConfig={config} originalGroups={groups} />; | ||
} | ||
|
||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<HeaderBar openSettings={() => setIsSettingsModalOpened(true)} /> | ||
|
||
<main> | ||
<CompareSchedule groups={groups} config={config} /> | ||
</main> | ||
|
||
<SettingsDialog | ||
open={isSettingsModalOpened} | ||
onClose={() => setIsSettingsModalOpened(false)} | ||
config={config} | ||
groups={groups} | ||
setConfig={setConfig} | ||
setGroups={setGroups} | ||
/> | ||
|
||
<Fab | ||
color="primary" | ||
sx={{ position: "fixed", bottom: 16, right: 16 }} | ||
onClick={() => shareGroupsUrl(groups)} | ||
> | ||
<ShareIcon /> | ||
</Fab> | ||
|
||
<ReactTooltip multiline effect="solid" /> | ||
</QueryClientProvider> | ||
); | ||
} | ||
|
||
export default App; |
Oops, something went wrong.