Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/build/api/docs.jsonopenapi.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions assets/js/src/core/app/api/pimcore/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const tagNames = {
USERS: 'USERS',
USER_DETAIL: 'USER_DETAIL',
USER_TREE: 'USER_TREE',
USER_OBJECT_DEPENDENCIES: 'USER_OBJECT_DEPENDENCIES',
GDPR_DATA: 'GDPR_DATA',
GDPR_DATA_DETAIL: 'GDPR_DATA_DETAIL',
CLASS_DEFINITION: 'CLASS_DEFINITION',
Expand Down Expand Up @@ -170,6 +171,7 @@ export const providingTags = {
USERS: () => [tagNames.USERS],
USER_DETAIL: (id: number) => [{ type: tagNames.USER_DETAIL, id }],
USER_TREE: () => [tagNames.USER_TREE],
USER_OBJECT_DEPENDENCIES: (id: number) => [{ type: tagNames.USER_OBJECT_DEPENDENCIES, id }],
GDPR_DATA: (providerKey: string) => [{ type: tagNames.GDPR_DATA, id: providerKey }],
GDPR_DATA_DETAIL: (providerKey: string, id: number) => [{ type: tagNames.GDPR_DATA_DETAIL, id: `${providerKey}-${id}` }],
CLASS_DEFINITION: () => [tagNames.CLASS_DEFINITION],
Expand Down
20 changes: 20 additions & 0 deletions assets/js/src/core/modules/asset/asset-api-slice.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ const injectedRtkApi = api
}),
invalidatesTags: ["Assets"],
}),
assetDownloadZipAvailable: build.query<
AssetDownloadZipAvailableApiResponse,
AssetDownloadZipAvailableApiArg
>({
query: (queryArg) => ({
url: `/pimcore-studio/api/assets/download/zip/${queryArg.jobRunId}/available`,
}),
providesTags: ["Assets"],
}),
assetDownloadById: build.query<AssetDownloadByIdApiResponse, AssetDownloadByIdApiArg>({
query: (queryArg) => ({ url: `/pimcore-studio/api/assets/${queryArg.id}/download` }),
providesTags: ["Assets"],
Expand Down Expand Up @@ -612,6 +621,12 @@ export type AssetDeleteZipApiArg = {
/** JobRunId of the JobRun */
jobRunId: number;
};
export type AssetDownloadZipAvailableApiResponse =
/** status 200 Availability flag for the ZIP archive */ DownloadAvailability;
export type AssetDownloadZipAvailableApiArg = {
/** JobRunId of the JobRun */
jobRunId: number;
};
export type AssetDownloadByIdApiResponse = /** status 200 Original asset binary file */ Blob;
export type AssetDownloadByIdApiArg = {
/** Id of the asset */
Expand Down Expand Up @@ -1077,6 +1092,10 @@ export type CustomSettings = {
/** dynamic custom settings - can be any key-value pair */
dynamicCustomSettings?: object[];
};
export type DownloadAvailability = {
/** Whether the exported file is still available for download */
available: boolean;
};
export type ExportAllFilter = {
/** Column Filter */
columnFilters: object;
Expand Down Expand Up @@ -1474,6 +1493,7 @@ export const {
useAssetDocumentStreamByThumbnailQuery,
useAssetDownloadZipQuery,
useAssetDeleteZipMutation,
useAssetDownloadZipAvailableQuery,
useAssetDownloadByIdQuery,
useAssetExportZipAssetMutation,
useAssetExportZipFolderMutation,
Expand Down
31 changes: 30 additions & 1 deletion assets/js/src/core/modules/auth/user/user-api-slice.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ const injectedRtkApi = api
query: () => ({ url: `/pimcore-studio/api/users/default-key-bindings` }),
providesTags: ["User Management"],
}),
userGetObjectDependencies: build.query<
UserGetObjectDependenciesApiResponse,
UserGetObjectDependenciesApiArg
>({
query: (queryArg) => ({
url: `/pimcore-studio/api/user/${queryArg.id}/object-dependencies`,
params: {
page: queryArg.page,
pageSize: queryArg.pageSize,
},
}),
providesTags: ["User Management"],
}),
userGetAvailablePermissions: build.query<
UserGetAvailablePermissionsApiResponse,
UserGetAvailablePermissionsApiArg
Expand Down Expand Up @@ -221,6 +234,19 @@ export type UserDefaultKeyBindingsApiResponse = /** status 200 List of default k
items: KeyBindingForAUser[];
};
export type UserDefaultKeyBindingsApiArg = void;
export type UserGetObjectDependenciesApiResponse =
/** status 200 Paginated object dependencies with total count returned both as a header param and as `totalItems` in the response body. */ {
totalItems: number;
items: DependencyToAnObject[];
};
export type UserGetObjectDependenciesApiArg = {
/** Id of the user */
id: number;
/** Page number */
page: number;
/** Number of items per page */
pageSize: number;
};
export type UserGetAvailablePermissionsApiResponse = /** status 200 List of available user permissions. */ {
totalItems: number;
items: UserPermission[];
Expand Down Expand Up @@ -472,8 +498,10 @@ export type DependencyToAnObject = {
export type UserObjectDependencies = {
/** Dependencies to objects */
dependencies: DependencyToAnObject[];
/** If is has hidden dependencies */
/** If it has hidden dependencies */
hasHidden: boolean;
/** Total number of objects referencing this user, including ones the caller is not permitted to view - not the count of objects actually returned via dependencies or the paginated endpoint. */
totalItems?: number;
};
export type User = {
/** AdditionalAttributes */
Expand Down Expand Up @@ -655,6 +683,7 @@ export const {
useUserGetImageQuery,
useUserImageDeleteByIdMutation,
useUserDefaultKeyBindingsQuery,
useUserGetObjectDependenciesQuery,
useUserGetAvailablePermissionsQuery,
useUserGetCollectionQuery,
useUserListWithPermissionQuery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ const injectedRtkApi = api
}),
providesTags: ["Workflows"],
}),
workflowGetElements: build.query<WorkflowGetElementsApiResponse, WorkflowGetElementsApiArg>({
query: (queryArg) => ({
url: `/pimcore-studio/api/workflows/elements/${queryArg.elementType}`,
params: {
workflowName: queryArg.workflowName,
stateName: queryArg.stateName,
page: queryArg.page,
pageSize: queryArg.pageSize,
},
}),
providesTags: ["Workflows"],
}),
workflowGetNames: build.query<WorkflowGetNamesApiResponse, WorkflowGetNamesApiArg>({
query: () => ({ url: `/pimcore-studio/api/workflows/names` }),
providesTags: ["Workflows"],
}),
workflowGetPlaces: build.query<WorkflowGetPlacesApiResponse, WorkflowGetPlacesApiArg>({
query: (queryArg) => ({
url: `/pimcore-studio/api/workflows/places`,
params: {
workflowName: queryArg.workflowName,
},
}),
providesTags: ["Workflows"],
}),
workflowActionSubmit: build.mutation<WorkflowActionSubmitApiResponse, WorkflowActionSubmitApiArg>({
query: (queryArg) => ({
url: `/pimcore-studio/api/workflows/action`,
Expand All @@ -38,6 +63,33 @@ export type WorkflowGetDetailsApiArg = {
/** Filter elements by matching element type. */
elementType: "asset" | "document" | "data-object";
};
export type WorkflowGetElementsApiResponse = /** status 200 Paginated list of elements in the given workflow state */ {
totalItems: number;
items: WorkflowElement[];
};
export type WorkflowGetElementsApiArg = {
/** Filter elements by matching element type. */
elementType: "asset" | "document" | "data-object";
/** Workflow name */
workflowName: string;
/** Workflow state / place name */
stateName?: string;
/** Page number */
page: number;
/** Number of items per page */
pageSize: number;
};
export type WorkflowGetNamesApiResponse = /** status 200 List of all configured workflow names */ {
items: string[];
};
export type WorkflowGetNamesApiArg = void;
export type WorkflowGetPlacesApiResponse = /** status 200 List of all configured place names for the workflow */ {
items: string[];
};
export type WorkflowGetPlacesApiArg = {
/** Name of the workflow */
workflowName: string;
};
export type WorkflowActionSubmitApiResponse =
/** status 200 Json encoded name of workflow, name and type of submitted action. */ {
workflowName?: string;
Expand Down Expand Up @@ -117,6 +169,30 @@ export type DevError = {
/** Details */
details: string;
};
export type WorkflowElement = {
/** AdditionalAttributes */
additionalAttributes?: {
[key: string]: string | number | boolean | object;
};
/** Element ID */
elementId: number;
/** Element type */
elementType: string;
/** Full path */
path: string;
/** Element key */
objectKey: string;
/** Workflow name */
workflowName: string;
/** Current state name */
stateName: string;
/** Human-readable state label */
stateLabel: string;
/** State color */
stateColor: string;
/** Modification timestamp */
modificationDate: number;
};
export type SubmitAction = {
/** type of the action */
actionType: string;
Expand All @@ -131,4 +207,10 @@ export type SubmitAction = {
/** workflowOptions */
workflowOptions: object | null;
};
export const { useWorkflowGetDetailsQuery, useWorkflowActionSubmitMutation } = injectedRtkApi;
export const {
useWorkflowGetDetailsQuery,
useWorkflowGetElementsQuery,
useWorkflowGetNamesQuery,
useWorkflowGetPlacesQuery,
useWorkflowActionSubmitMutation,
} = injectedRtkApi;
36 changes: 36 additions & 0 deletions assets/js/src/core/modules/element/export-api-slice.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ const injectedRtkApi = api
})
.injectEndpoints({
endpoints: (build) => ({
exportDownloadCsvAvailable: build.query<
ExportDownloadCsvAvailableApiResponse,
ExportDownloadCsvAvailableApiArg
>({
query: (queryArg) => ({
url: `/pimcore-studio/api/export/download/csv/${queryArg.jobRunId}/available`,
}),
providesTags: ["Export"],
}),
exportDownloadCsv: build.query<ExportDownloadCsvApiResponse, ExportDownloadCsvApiArg>({
query: (queryArg) => ({ url: `/pimcore-studio/api/export/download/csv/${queryArg.jobRunId}` }),
providesTags: ["Export"],
Expand All @@ -29,6 +38,15 @@ const injectedRtkApi = api
}),
invalidatesTags: ["Export"],
}),
exportDownloadXlsxAvailable: build.query<
ExportDownloadXlsxAvailableApiResponse,
ExportDownloadXlsxAvailableApiArg
>({
query: (queryArg) => ({
url: `/pimcore-studio/api/export/download/xlsx/${queryArg.jobRunId}/available`,
}),
providesTags: ["Export"],
}),
exportDownloadXlsx: build.query<ExportDownloadXlsxApiResponse, ExportDownloadXlsxApiArg>({
query: (queryArg) => ({ url: `/pimcore-studio/api/export/download/xlsx/${queryArg.jobRunId}` }),
providesTags: ["Export"],
Expand Down Expand Up @@ -56,6 +74,12 @@ const injectedRtkApi = api
overrideExisting: false,
});
export { injectedRtkApi as api };
export type ExportDownloadCsvAvailableApiResponse =
/** status 200 Availability flag for the CSV export */ DownloadAvailability;
export type ExportDownloadCsvAvailableApiArg = {
/** JobRunId of the JobRun */
jobRunId: number;
};
export type ExportDownloadCsvApiResponse = /** status 200 CSV File as attachment */ Blob;
export type ExportDownloadCsvApiArg = {
/** JobRunId of the JobRun */
Expand Down Expand Up @@ -168,6 +192,12 @@ export type ExportCsvFolderApiArg = {
classId?: string | null;
};
};
export type ExportDownloadXlsxAvailableApiResponse =
/** status 200 Availability flag for the XLSX export */ DownloadAvailability;
export type ExportDownloadXlsxAvailableApiArg = {
/** JobRunId of the JobRun */
jobRunId: number;
};
export type ExportDownloadXlsxApiResponse = /** status 200 XLSX File as attachment */ Blob;
export type ExportDownloadXlsxApiArg = {
/** JobRunId of the JobRun */
Expand Down Expand Up @@ -279,6 +309,10 @@ export type ExportXlsxFolderApiArg = {
classId?: string | null;
};
};
export type DownloadAvailability = {
/** Whether the exported file is still available for download */
available: boolean;
};
export type Error = {
/** Message */
message: string;
Expand Down Expand Up @@ -350,10 +384,12 @@ export type ExportAllFilter = {
additionalSortFilters?: object[];
};
export const {
useExportDownloadCsvAvailableQuery,
useExportDownloadCsvQuery,
useExportDeleteCsvMutation,
useExportCsvMutation,
useExportCsvFolderMutation,
useExportDownloadXlsxAvailableQuery,
useExportDownloadXlsxQuery,
useExportDeleteXlsxMutation,
useExportXlsxMutation,
Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/core/modules/search/search-api-slice.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ export type SavedSearchDetailedConfiguration = {
};
/** ID of the saved search configuration */
id: number;
/** ID of the owner */
ownerId: number;
/** ID of the owner. Null when the owner has been deleted. */
ownerId: number | null;
/** Name */
name: string;
/** Description */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* This source file is available under the terms of the
* Pimcore Open Core License (POCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
* @license Pimcore Open Core License (POCL)
*/

import React from 'react'
import { type UserGetObjectDependenciesApiResponse } from '@Pimcore/modules/user/user-api-slice-enhanced'
import { useTranslation } from 'react-i18next'
import { Pagination as PimPagination } from '@Pimcore/components/pagination/pagination'
import {
PaginationSkeleton
} from '@Pimcore/modules/element/editor/shared-tab-manager/tabs/dependencies/components/pagination/skeleton'
import { DEFAULT_PAGE_SIZE } from '@Pimcore/modules/user/management/detail/tabs/references/constants'

type PaginationProps = Partial<UserGetObjectDependenciesApiResponse> & {
page: number
isLoading: boolean
onChange: (page: number, pageSize: number) => void
}

export const Pagination = (props: PaginationProps): React.JSX.Element => {
const { t } = useTranslation()

if (props.isLoading) {
return <PaginationSkeleton />
}

if (!props.isLoading && props.totalItems === 0) {
return <></>
}

return (
<PimPagination
current={ props.page }
defaultPageSize={ DEFAULT_PAGE_SIZE }
onChange={ props.onChange }
pageSizeOptions={ [10, 20, 50, 100] }
showSizeChanger
showTotal={ (total) => t('pagination.show-total', { total }) }
Comment thread
jcPimcore marked this conversation as resolved.
total={ props.totalItems ?? 0 }
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* This source file is available under the terms of the
* Pimcore Open Core License (POCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
* @license Pimcore Open Core License (POCL)
*/

export const DEFAULT_PAGE_SIZE = 20
Loading
Loading