Skip to content

Commit

Permalink
fix(api-operations): fix choose status on base
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Nov 15, 2024
1 parent 9abb575 commit 6b5a61f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/src/components/selectors/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Selectors = ({
<option value="ongoing">Contribution en traitement</option>
<option value="treated">Contributions traitées</option>
</select>
{location.pathname !== "/apioperations" && (
{location.pathname !== "/scanr-apioperations" && (
<Toggle
checked={searchInMessage}
id="searchInMessage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useDataList } from "./data-list-context";
const ContributionPage: React.FC<ContributionPageProps> = () => {
const [reload] = useState(0);
const [sort, setSort] = useState("DESC");
const [status, setStatus] = useState("new");
const [status, setStatus] = useState("choose");
const [query, setQuery] = useState<string[]>([]);
const [page, setPage] = useState(1);
const location = useLocation();
Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/home/components/generate-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export function generateLinkFromAllDatas(
fromApplication?: string,
id?: string,
objectId?: boolean,
productions?: Array<any>
productions?: Array<any>,
message?: string
): string {
const basePathMap: { [key: string]: { [key: string]: string } | string } = {
contacts: {
Expand All @@ -21,8 +22,7 @@ export function generateLinkFromAllDatas(
};

let basePath = "";

if (productions?.length > 1) {
if (productions?.length > 0 && message === undefined) {
basePath = "/scanr-apioperations";
} else if (objectId) {
basePath = "/scanr-contributionPage";
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/home/components/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const AllContributions: React.FC<AllContributionsProps & { query: string }> = ({
email.fromApplication,
email.id,
email.objectId,
email.productions
email.productions,
email.message
);
const creationDate = new Date(email.created_at);
const formattedDate = creationDate.toLocaleDateString("fr-FR");
Expand All @@ -44,7 +45,7 @@ const AllContributions: React.FC<AllContributionsProps & { query: string }> = ({
});

let badgeContent = "";
if (email.productions?.length > 1) {
if (email.productions?.length > 0) {
badgeContent = "Lier des publications";
} else if (email.objectId && !email.productions) {
badgeContent = "Contribution par objet";
Expand Down

0 comments on commit 6b5a61f

Please sign in to comment.