Skip to content

Commit

Permalink
[TAN-3370] Revert FE changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjagit committed Dec 16, 2024
1 parent 50aed50 commit f2de028
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions front/app/api/admin_publications/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface IQueryParameters {
pageNumber?: number;
pageSize?: number;
rootLevelOnly?: boolean;
removeNotAllowedParents?: boolean;
onlyProjects?: boolean;
filter_is_moderator_of?: boolean;
filter_user_is_moderator_of?: string;
Expand Down
2 changes: 2 additions & 0 deletions front/app/api/admin_publications/useAdminPublications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const fetchAdminPublications = (filters: IQueryParameters) => {
pageNumber,
pageSize,
rootLevelOnly,
removeNotAllowedParents,
publicationStatusFilter,
childrenOfId,
topicIds,
Expand All @@ -30,6 +31,7 @@ export const fetchAdminPublications = (filters: IQueryParameters) => {
'page[number]': pageNumber || 1,
'page[size]': pageSize || 1000,
depth: rootLevelOnly ? 0 : undefined,
remove_not_allowed_parents: removeNotAllowedParents,
publication_statuses: publicationStatusFilter,
folder: childrenOfId,
topics: topicIds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { IStatusCounts, AdminPublicationsStatusCountsKeys } from './types';

export const fetchStatusCounts = ({
rootLevelOnly,
removeNotAllowedParents,
publicationStatusFilter,
childrenOfId,
topicIds,
Expand All @@ -25,6 +26,7 @@ export const fetchStatusCounts = ({
'page[size]': undefined,
'page[number]': undefined,
depth: rootLevelOnly ? 0 : undefined,
remove_not_allowed_parents: removeNotAllowedParents,
publication_statuses: publicationStatusFilter,
folder: childrenOfId,
topics: topicIds,
Expand Down
3 changes: 3 additions & 0 deletions front/app/components/ProjectAndFolderCards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const ProjectAndFolderCards = ({
{
publicationStatusFilter: PUBLICATION_STATUSES,
rootLevelOnly,
removeNotAllowedParents: true,
topicIds,
areaIds,
search,
Expand All @@ -85,6 +86,7 @@ const ProjectAndFolderCards = ({
pageSize: 6,
publicationStatusFilter: getPublicationStatuses(currentTab),
rootLevelOnly,
removeNotAllowedParents: true,
topicIds,
areaIds,
search,
Expand Down Expand Up @@ -134,6 +136,7 @@ const ProjectAndFolderCardsWrapper = (props: Props) => {
{
publicationStatusFilter: PUBLICATION_STATUSES,
rootLevelOnly: true,
removeNotAllowedParents: true,
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Published = ({ titleMultiloc }: Props) => {
pageSize: 6,
publicationStatusFilter: ['published'],
rootLevelOnly: true,
removeNotAllowedParents: true,
include_publications: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const CustomPageProjectsAndEvents = ({
areaIds,
publicationStatusFilter: getPublicationStatuses(currentTab),
rootLevelOnly: false,
removeNotAllowedParents: true,
onlyProjects: true,
});

Expand Down Expand Up @@ -137,6 +138,7 @@ const CustomPageProjectsAndEventsWrapper = ({ page }: Props) => {
areaIds,
publicationStatusFilter: PUBLICATION_STATUSES,
rootLevelOnly: false,
removeNotAllowedParents: true,
onlyProjects: true,
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const AdminPublicationsNavbarItem = ({
{
publicationStatusFilter: ['published', 'archived'],
rootLevelOnly: true,
removeNotAllowedParents: true,
},
{ enabled: projectsDropdownOpened }
);
Expand Down
1 change: 1 addition & 0 deletions front/app/containers/SiteMap/ProjectsAndFoldersSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const ProjectsAndFoldersSection = ({ projectsSectionRef }: Props) => {
const { data } = useAdminPublications({
publicationStatusFilter: ['draft', 'published', 'archived'],
rootLevelOnly: true,
removeNotAllowedParents: true,
});

const adminPublications = data?.pages.map((page) => page.data).flat();
Expand Down

0 comments on commit f2de028

Please sign in to comment.