Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
ericjeangirard committed Oct 23, 2024
2 parents e420bbb + 3d4fe2c commit f6e56c2
Show file tree
Hide file tree
Showing 16 changed files with 628 additions and 217 deletions.
File renamed without changes.
136 changes: 0 additions & 136 deletions client/src/mentions/index.jsx

This file was deleted.

26 changes: 0 additions & 26 deletions client/src/mentions/index.scss

This file was deleted.

14 changes: 8 additions & 6 deletions client/src/pages/actions/actionsAffiliations.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { useState } from 'react';
import { useSearchParams } from 'react-router-dom';
import PropTypes from 'prop-types';
import {
Button,
Container, Row, Col,
Col,
Container,
Modal, ModalContent,
Row,
Title,
} from '@dataesr/dsfr-plus';
import useToast from '../../hooks/useToast';
import PropTypes from 'prop-types';
import { useState } from 'react';
import { useSearchParams } from 'react-router-dom';

import File from '../../components/file';
import { status } from '../../config';
import useToast from '../../hooks/useToast';
import { export2json, importJson } from '../../utils/files';
import File from '../../components/File';

export default function ActionsAffiliations({
allAffiliations,
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/filters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function Filters({
useEffect(() => {
const getData = async () => {
if (searchParams.size === 0) {
// default values
// Set default params values
setSearchParams({
affiliations: [],
datasets: false,
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import PublicationsTile from '../components/tiles/publications';
import { status } from '../config';
import { getWorks } from '../utils/works';
import Filters from './filters';
import useToast from '../hooks/useToast';
import Datasets from './views/datasets';
import Openalex from './views/openalex';
import Publications from './views/publications';
Expand All @@ -24,6 +25,7 @@ export default function Home({ isSticky, setIsSticky }) {
const [selectedAffiliations, setSelectedAffiliations] = useState([]);
const [selectedDatasets, setSelectedDatasets] = useState([]);
const [selectedPublications, setSelectedPublications] = useState([]);
const { toast } = useToast();

const setView = (_view) => {
setSearchParams((params) => {
Expand All @@ -34,7 +36,7 @@ export default function Home({ isSticky, setIsSticky }) {

const { data, error, isFetched, isFetching, refetch } = useQuery({
queryKey: ['data', JSON.stringify(options)],
queryFn: () => getWorks(options),
queryFn: () => getWorks(options, toast),
enabled: false,
cacheTime: 60 * (60 * 1000), // 1h
});
Expand Down Expand Up @@ -78,7 +80,6 @@ export default function Home({ isSticky, setIsSticky }) {
.map((affiliation) => (affiliation.status = action));
setSelectedAffiliations([]);
};

return (
// TODO:do a cleaner way to display the spinner and views
<>
Expand Down
Loading

0 comments on commit f6e56c2

Please sign in to comment.