Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29,177 changes: 6,778 additions & 22,399 deletions assets/build/api/docs.jsonopenapi.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export const useValue = (
return value?.some(item => item.id === id && item.type === type) ?? false
}

function mapNewValues (value: ManyToManyRelationValue, data: { items: Array<{ objectReference: string, formatedPath: string }> }): DisplayManyToManyRelationValue {
function mapNewValues (value: ManyToManyRelationValue, data: { items: Array<{ objectReference: string | number, formatedPath: string | number }> }): DisplayManyToManyRelationValue {
return value.map((item): DisplayManyToManyRelationValueItem => ({
...item,
originalPath: item.fullPath,
fullPath: data.items.find(i => i.objectReference === `${item.type}_${item.id}`)?.formatedPath ?? item.fullPath
fullPath: String(data.items.find(i => String(i.objectReference) === `${item.type}_${item.id}`)?.formatedPath ?? item.fullPath)
}))
}

Expand Down Expand Up @@ -164,16 +164,16 @@ export const useValue = (

function applyFormattingWithLoadingState (
items: ManyToManyRelationValue,
cachedData?: { items: Array<{ objectReference: string, formatedPath: string }> }
cachedData?: { items: Array<{ objectReference: string | number, formatedPath: string | number }> }
): DisplayManyToManyRelationValue {
return items.map((item): DisplayManyToManyRelationValueItem => {
const objectReference = `${item.type}_${item.id}`
const cachedItem = cachedData?.items.find(cached => cached.objectReference === objectReference)
const cachedItem = cachedData?.items.find(cached => String(cached.objectReference) === objectReference)

return {
...item,
originalPath: item.fullPath,
fullPath: cachedItem?.formatedPath ?? item.fullPath,
fullPath: String(cachedItem?.formatedPath ?? item.fullPath),
loading: isNil(cachedItem)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export const PathTarget = forwardRef(function PathTarget (

const hasPathFormatterClass = isNonEmptyString(props.pathFormatterClass)

function mapNewValue (value: IFormatPathItem[], data: { items: Array<{ objectReference: string, formatedPath: string }> }): IFormatPathItem[] {
function mapNewValue (value: IFormatPathItem[], data: { items: Array<{ objectReference: string | number, formatedPath: string | number }> }): IFormatPathItem[] {
return value.map((item) => ({
...item,
fullPath: data.items.find(i => i.objectReference === `${item.type}_${item.id}`)?.formatedPath ?? item.fullPath
fullPath: String(data.items.find(i => String(i.objectReference) === `${item.type}_${item.id}`)?.formatedPath ?? item.fullPath)
}))
}

Expand Down
2 changes: 1 addition & 1 deletion assets/js/src/core/components/progressbar/progressbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const Progressbar = ({ progressStatus, description, descriptionAction, ..
</div>
</div>
<Progress
status='normal'
{ ...props }
aria-labelledby={ 'progressbarLabel' }
showInfo={ false }
status='normal'
/>
<div className={ 'progressbar-status' }>
<p>{progressStatus}</p>
Expand Down
8 changes: 4 additions & 4 deletions assets/js/src/core/modules/asset/asset-api-slice.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ const injectedRtkApi = api
}),
assetPatchFolderById: build.mutation<AssetPatchFolderByIdApiResponse, AssetPatchFolderByIdApiArg>({
query: (queryArg) => ({
url: `/pimcore-studio/api/assets/folder`,
url: `/pimcore-studio/api/assets/folder/${queryArg.id}`,
method: "PATCH",
body: queryArg.body,
}),
Expand Down Expand Up @@ -876,15 +876,15 @@ export type AssetPatchFolderByIdApiResponse =
jobRunId: number;
};
export type AssetPatchFolderByIdApiArg = {
/** Id of the folder */
id: number;
body: {
data: {
/** Folder ID */
folderId: number;
parentId?: number | null;
key?: string | null;
locked?: string | null;
metadata?: PatchCustomMetadata[] | null;
}[];
};
filters?: ExportAllFilter;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ const injectedRtkApi = api
MetadataPredefinedCreateApiResponse,
MetadataPredefinedCreateApiArg
>({
query: () => ({ url: `/pimcore-studio/api/metadata/predefined`, method: "POST" }),
query: (queryArg) => ({
url: `/pimcore-studio/api/metadata/predefined`,
method: "POST",
body: queryArg.createPredefinedMetadata,
}),
invalidatesTags: ["Metadata"],
}),
metadataPredefinedUpdate: build.mutation<
Expand Down Expand Up @@ -104,7 +108,9 @@ export type MetadataGetCollectionApiArg = {
};
export type MetadataPredefinedCreateApiResponse =
/** status 200 Newly created predefined metadata entry */ PredefinedMetadata;
export type MetadataPredefinedCreateApiArg = void;
export type MetadataPredefinedCreateApiArg = {
createPredefinedMetadata: CreatePredefinedMetadata;
};
export type MetadataPredefinedUpdateApiResponse =
/** status 200 Updated predefined metadata entry */ PredefinedMetadata;
export type MetadataPredefinedUpdateApiArg = {
Expand Down Expand Up @@ -171,6 +177,24 @@ export type CustomMetadata = {
/** Data */
data: any | null;
};
export type CreatePredefinedMetadata = {
/** Name */
name: string;
/** Type */
type: string;
/** Description */
description: string | null;
/** Target sub type */
targetSubType: string | null;
/** Data */
data: any | null;
/** Config */
config: string | null;
/** Language */
language: string | null;
/** Group */
group: string | null;
};
export type UpdatePredefinedMetadata = {
/** Name */
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const injectedRtkApi = api
DataObjectPatchFolderByIdApiArg
>({
query: (queryArg) => ({
url: `/pimcore-studio/api/data-objects/folder`,
url: `/pimcore-studio/api/data-objects/folder/${queryArg.id}`,
method: "PATCH",
body: queryArg.body,
}),
Expand Down Expand Up @@ -476,10 +476,10 @@ export type DataObjectPatchFolderByIdApiResponse =
jobRunId: number;
};
export type DataObjectPatchFolderByIdApiArg = {
/** Id of the folder */
id: number;
body: {
data: {
/** Folder ID */
folderId: number;
parentId?: number | null;
index?: number | null;
key?: string | null;
Expand All @@ -488,7 +488,7 @@ export type DataObjectPatchFolderByIdApiArg = {
childrenSortOrder?: string | null;
published?: boolean | null;
editableData?: object | null;
}[];
};
filters?: ExportAllFilter;
classId: string;
};
Expand Down Expand Up @@ -940,9 +940,9 @@ export type SelectOption = {
[key: string]: string | number | boolean | object;
};
/** Object Reference */
objectReference: string;
objectReference: string | number;
/** Formated Path */
formatedPath: string;
formatedPath: string | number;
};
export type SelectOption2 = {
/** AdditionalAttributes */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ export const useFormatPath = (): UseFormatPathReturn => {
itemsToRequest: IFormatPathItem[]
): void => {
data.items?.forEach(item => {
const originalItem = itemsToRequest.find(reqItem => `${reqItem.type}_${reqItem.id}` === item.objectReference)
const originalItem = itemsToRequest.find(reqItem => `${reqItem.type}_${reqItem.id}` === String(item.objectReference))
if (!isNil(originalItem)) {
const cacheKey = buildCacheKey(dataObjectId, fieldName, originalItem.type, originalItem.id)
formatPathCache.set(cacheKey, item.formatedPath)
formatPathCache.set(cacheKey, String(item.formatedPath))
}
})
}
Expand Down
24 changes: 16 additions & 8 deletions assets/js/src/core/modules/element/export-api-slice.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const injectedRtkApi = api
}),
exportCsvFolder: build.mutation<ExportCsvFolderApiResponse, ExportCsvFolderApiArg>({
query: (queryArg) => ({
url: `/pimcore-studio/api/export/csv/folder`,
url: `/pimcore-studio/api/export/csv/folder/${queryArg.id}`,
method: "POST",
body: queryArg.body,
}),
Expand All @@ -46,7 +46,7 @@ const injectedRtkApi = api
}),
exportXlsxFolder: build.mutation<ExportXlsxFolderApiResponse, ExportXlsxFolderApiArg>({
query: (queryArg) => ({
url: `/pimcore-studio/api/export/xlsx/folder`,
url: `/pimcore-studio/api/export/xlsx/folder/${queryArg.id}`,
method: "POST",
body: queryArg.body,
}),
Expand Down Expand Up @@ -80,8 +80,9 @@ export type ExportCsvApiArg = {
| "custom_report_config"
| "custom_report_to_export"
| "element_class_id"
| "element_to_export"
| "elements_to_export"
| "element_type"
| "export_format"
| "folder_to_export"
| "grid_export_data"
| "grid_export_data_info"
Expand All @@ -101,15 +102,17 @@ export type ExportCsvApiArg = {
delimiter?: string;
};
elementType?: "data-object" | "object" | "asset" | "document";
classId?: string | null;
};
};
export type ExportCsvFolderApiResponse = /** status 201 Successfully created <strong>jobRun</strong> for csv export */ {
/** ID of created jobRun */
jobRunId: number;
};
export type ExportCsvFolderApiArg = {
/** Id of the folder */
id: number;
body: {
folders?: number[];
columns?: GridColumnRequest[];
filters?: ExportAllFilter;
config?: {
Expand All @@ -118,8 +121,9 @@ export type ExportCsvFolderApiArg = {
| "custom_report_config"
| "custom_report_to_export"
| "element_class_id"
| "element_to_export"
| "elements_to_export"
| "element_type"
| "export_format"
| "folder_to_export"
| "grid_export_data"
| "grid_export_data_info"
Expand Down Expand Up @@ -166,8 +170,9 @@ export type ExportXlsxApiArg = {
| "custom_report_config"
| "custom_report_to_export"
| "element_class_id"
| "element_to_export"
| "elements_to_export"
| "element_type"
| "export_format"
| "folder_to_export"
| "grid_export_data"
| "grid_export_data_info"
Expand All @@ -186,6 +191,7 @@ export type ExportXlsxApiArg = {
| "bool";
};
elementType?: "data-object" | "object" | "asset" | "document";
classId?: string | null;
};
};
export type ExportXlsxFolderApiResponse =
Expand All @@ -194,8 +200,9 @@ export type ExportXlsxFolderApiResponse =
jobRunId: number;
};
export type ExportXlsxFolderApiArg = {
/** Id of the folder */
id: number;
body: {
folders?: number[];
columns?: GridColumnRequest[];
filters?: ExportAllFilter;
config?: {
Expand All @@ -204,8 +211,9 @@ export type ExportXlsxFolderApiArg = {
| "custom_report_config"
| "custom_report_to_export"
| "element_class_id"
| "element_to_export"
| "elements_to_export"
| "element_type"
| "export_format"
| "folder_to_export"
| "grid_export_data"
| "grid_export_data_info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export const CsvModal = (props: CsvModalProps): React.JSX.Element => {
const job = new DownloadJob({
title: t('jobs.csv-job.title', { title: jobTitle }),
downloadUrl: `${getPrefix()}/export/download/csv/{jobRunId}`,
action: async () => await getDownloadAction(values.delimiter, values.header)
action: async () => await getDownloadAction(values.delimiter, values.header),
twoStep: numberedSelectedRows.length === 0
})
void executionEngine.runJob(job)

Expand Down Expand Up @@ -148,8 +149,8 @@ export const CsvModal = (props: CsvModalProps): React.JSX.Element => {
}

const promise = fetchCreateFolderCsv({
id,
body: {
folders: [id],
elementType,
columns: extractedColumnsFromColumnArg,
config: {
Expand All @@ -175,7 +176,8 @@ export const CsvModal = (props: CsvModalProps): React.JSX.Element => {
config: {
delimiter,
header
}
},
...(!isNil(selectedClassDefinition?.id) && { classId: selectedClassDefinition.id })
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export const XlsxModal = (props: XlsxModalProps): React.JSX.Element => {
const job = new DownloadJob({
title: t('jobs.xlsx-job.title', { title: jobTitle }),
downloadUrl: `${getPrefix()}/export/download/xlsx/{jobRunId}`,
action: async () => await getDownloadAction(values.header)
action: async () => await getDownloadAction(values.header),
twoStep: numberedSelectedRows.length === 0
})
void executionEngine.runJob(job)

Expand Down Expand Up @@ -146,8 +147,8 @@ export const XlsxModal = (props: XlsxModalProps): React.JSX.Element => {
}

const promise = fetchCreateFolderXlsx({
id,
body: {
folders: [id],
elementType,
columns: extractedColumnsFromColumnArg,
config: {
Expand All @@ -171,7 +172,8 @@ export const XlsxModal = (props: XlsxModalProps): React.JSX.Element => {
columns: extractedColumnsFromColumnArg,
config: {
header
}
},
...(!isNil(selectedClassDefinition?.id) && { classId: selectedClassDefinition.id })
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { isNil } from 'lodash'
import trackError, { GeneralError } from '@Pimcore/modules/app/error-handler'
import { type JobInterface, type JobRunOptions } from '../job-interface'
import { MessageBusJobHandler, type JobCompletionData } from '../../message-handlers/message-bus-job/message-bus-job-handler'
import { MessageBusJobHandler, type JobCompletionData, type MessageBusJobHandlerOptions } from '../../message-handlers/message-bus-job/message-bus-job-handler'
import { type JobButtonCustomizationContext } from '../../message-handlers/message-bus-job/message-bus-job-notification'
import { t } from 'i18next'

Expand Down Expand Up @@ -46,7 +46,7 @@ export abstract class AbstractBatchEditJob implements JobInterface {
return
}

const handler = new MessageBusJobHandler({
const handler = this.createHandler({
jobRunId,
title: this.title,
onJobCompletion: async (data: JobCompletionData) => {
Expand Down Expand Up @@ -83,6 +83,10 @@ export abstract class AbstractBatchEditJob implements JobInterface {
}
}

protected createHandler (options: MessageBusJobHandlerOptions): MessageBusJobHandler {
return new MessageBusJobHandler(options)
}

protected abstract executeEditRequest (): Promise<number | null>

protected async handleCompletion (): Promise<void> {
Expand Down
Loading