-
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.
chore and fix: replace files, clean code, and resize cols
- Loading branch information
Showing
25 changed files
with
242 additions
and
160 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
Empty file.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
contactUrl, | ||
contributionUrl, | ||
nameChangeUrl, | ||
productionUrl, | ||
removeUserUrl, | ||
} from "../config/api"; | ||
|
||
export function getUrlToSend(pathname: string): string { | ||
if (pathname.includes("contributionPage")) { | ||
return contributionUrl; | ||
} | ||
if (pathname.includes("scanr-removeuser")) { | ||
return removeUserUrl; | ||
} | ||
if (pathname.includes("scanr-namechange")) { | ||
return nameChangeUrl; | ||
} | ||
if (pathname.includes("apioperations")) { | ||
return productionUrl; | ||
} | ||
return contactUrl; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
client/src/pages/api-operation-page/link-publications/contributor-requests.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
2 changes: 1 addition & 1 deletion
2
client/src/pages/api-operation-page/link-publications/data-list-context/index.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
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
35 changes: 35 additions & 0 deletions
35
client/src/pages/contact-contributionbyobject-page/components/contribution-details.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,35 @@ | ||
import { Text } from "@dataesr/dsfr-plus"; | ||
import { Contribution } from "../../../types"; | ||
import ContributionItem from "./contribution-item"; | ||
|
||
const ContributionDetails: React.FC<{ | ||
filteredContributions: Contribution[]; | ||
selectedContribution: string; | ||
refetch: () => void; | ||
highlightedQuery: string; | ||
allTags: string[]; | ||
url: string; | ||
}> = ({ | ||
filteredContributions, | ||
selectedContribution, | ||
refetch, | ||
highlightedQuery, | ||
allTags, | ||
url, | ||
}) => | ||
filteredContributions && filteredContributions.length > 0 ? ( | ||
<ContributionItem | ||
allTags={allTags} | ||
key={selectedContribution} | ||
data={filteredContributions.find( | ||
(contribution) => contribution?.id === selectedContribution | ||
)} | ||
refetch={refetch} | ||
highlightedQuery={highlightedQuery} | ||
url={url} | ||
/> | ||
) : ( | ||
<Text>Aucune contribution trouvée.</Text> | ||
); | ||
|
||
export default ContributionDetails; |
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
14 changes: 14 additions & 0 deletions
14
client/src/pages/contact-contributionbyobject-page/components/page-title.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,14 @@ | ||
import { Title } from "@dataesr/dsfr-plus"; | ||
|
||
const PageTitle: React.FC<{ pathname: string }> = ({ pathname }) => { | ||
const getTitle = () => { | ||
if (pathname.includes("contributionPage")) return "Contribution par objets"; | ||
if (pathname.includes("removeuser")) return "Demande de suppression"; | ||
if (pathname.includes("namechange")) return "Demande de changement de nom"; | ||
return "Contribution via formulaire de contact"; | ||
}; | ||
|
||
return <Title as="h1">{getTitle()}</Title>; | ||
}; | ||
|
||
export default PageTitle; |
26 changes: 26 additions & 0 deletions
26
client/src/pages/contact-contributionbyobject-page/components/pagination-section.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,26 @@ | ||
import BottomPaginationButtons from "../../../components/pagination/bottom-buttons"; | ||
import TopPaginationButtons from "../../../components/pagination/top-buttons"; | ||
|
||
const TopPaginationSection: React.FC<{ | ||
meta: any; | ||
page: number; | ||
maxPage: number; | ||
setPage: (page: number) => void; | ||
}> = ({ meta, page, maxPage, setPage }) => ( | ||
<TopPaginationButtons | ||
meta={meta} | ||
page={page} | ||
maxPage={maxPage} | ||
setPage={setPage} | ||
/> | ||
); | ||
|
||
const BottomPaginationSection: React.FC<{ | ||
page: number; | ||
maxPage: number; | ||
setPage: (page: number) => void; | ||
}> = ({ page, maxPage, setPage }) => ( | ||
<BottomPaginationButtons page={page} maxPage={maxPage} setPage={setPage} /> | ||
); | ||
|
||
export { TopPaginationSection, BottomPaginationSection }; |
33 changes: 33 additions & 0 deletions
33
client/src/pages/contact-contributionbyobject-page/components/search-section.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,33 @@ | ||
import { DismissibleTag, SearchBar } from "@dataesr/dsfr-plus"; | ||
|
||
const SearchSection: React.FC<{ | ||
query: string[]; | ||
handleSearch: (value: string) => void; | ||
handleRemoveQueryItem: (item: string) => void; | ||
}> = ({ query, handleSearch, handleRemoveQueryItem }) => ( | ||
<> | ||
<SearchBar | ||
className="fr-mb-1w" | ||
onSearch={(value) => handleSearch(value || "")} | ||
isLarge | ||
buttonLabel="Rechercher" | ||
placeholder="Rechercher par nom ou ID" | ||
/> | ||
<div className="fr-mb-1w"> | ||
{query | ||
.filter((item) => item.trim() !== "") | ||
.map((item, index) => ( | ||
<DismissibleTag | ||
key={index} | ||
color="purple-glycine" | ||
className="fr-mr-1w" | ||
onClick={() => handleRemoveQueryItem(item)} | ||
> | ||
{item} | ||
</DismissibleTag> | ||
))} | ||
</div> | ||
</> | ||
); | ||
|
||
export default SearchSection; |
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
File renamed without changes.
Oops, something went wrong.