Skip to content

Commit

Permalink
merged changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeriaMaltseva committed Nov 21, 2024
2 parents 6b3ab68 + c70b05f commit ced4645
Show file tree
Hide file tree
Showing 119 changed files with 16,969 additions and 21,338 deletions.
10 changes: 8 additions & 2 deletions assets/js/src/core/app/config/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { DocumentTabManager } from '@Pimcore/modules/asset/editor/types/document
import { VideoTabManager } from '@Pimcore/modules/asset/editor/types/video/tab-manager/video-tab-manager'
import { AudioTabManager } from '@Pimcore/modules/asset/editor/types/audio/tab-manager/audio-tab-manager'
import { UnknownTabManager } from '@Pimcore/modules/asset/editor/types/unknown/tab-manager/unknown-tab-manager'
import { MetadataTypeRegistry } from '@Pimcore/modules/asset/metadata-type-provider/services/metadata-type-registry'
import { JobComponentRegistry } from '@Pimcore/modules/execution-engine/services/job-component-registry'
import { ArchiveTabManager } from '@Pimcore/modules/asset/editor/types/archive/tab-manager/archive-tab-manager'
import { ComponentRegistry } from '@Pimcore/modules/app/component-registry/component-registry'
Expand Down Expand Up @@ -102,6 +101,10 @@ import { DynamicTypeObjectDataTime } from '@Pimcore/modules/element/dynamic-type
import { DynamicTypeObjectDataExternalImage } from '@Pimcore/modules/element/dynamic-types/defintinitions/objects/data-related/types/dynamic-type-object-data-external-image'
import { DynamicTypeObjectDataBlock } from '@Pimcore/modules/element/dynamic-types/defintinitions/objects/data-related/types/dynamic-type-object-data-block'
import { DynamicTypeObjectDataLocalizedFields } from '@Pimcore/modules/element/dynamic-types/defintinitions/objects/data-related/types/dynamic-type-object-data-localized-fields'
import { DynamicTypeGridCellAsset } from '@Pimcore/modules/element/dynamic-types/defintinitions/grid-cell/types/asset/dynamic-type-grid-cell-asset'
import { DynamicTypeGridCellObject } from '@Pimcore/modules/element/dynamic-types/defintinitions/grid-cell/types/object/dynamic-type-grid-cell-object'
import { DynamicTypeGridCellDocument } from '@Pimcore/modules/element/dynamic-types/defintinitions/grid-cell/types/document/dynamic-type-grid-cell-document'
import { DynamicTypeGridCellLanguageSelect } from '@Pimcore/modules/element/dynamic-types/defintinitions/grid-cell/types/language-select/dynamic-type-grid-cell-language-select'

// Widget manager
container.bind(serviceIds.widgetManager).to(WidgetRegistry).inSingletonScope()
Expand All @@ -116,7 +119,6 @@ container.bind(serviceIds['Asset/Editor/VideoTabManager']).to(VideoTabManager).i
container.bind(serviceIds['Asset/Editor/AudioTabManager']).to(AudioTabManager).inSingletonScope()
container.bind(serviceIds['Asset/Editor/ArchiveTabManager']).to(ArchiveTabManager).inSingletonScope()
container.bind(serviceIds['Asset/Editor/UnknownTabManager']).to(UnknownTabManager).inSingletonScope()
container.bind(serviceIds['Asset/MetadataTypeProvider/MetadataTypeRegistry']).to(MetadataTypeRegistry).inSingletonScope()

// Data Objects
container.bind(serviceIds['DataObject/Editor/TypeRegistry']).to(TypeRegistry).inSingletonScope()
Expand Down Expand Up @@ -157,6 +159,10 @@ container.bind(serviceIds['DynamicTypes/GridCell/PropertyValue']).to(DynamicType
container.bind(serviceIds['DynamicTypes/GridCell/ScheduleActionsSelect']).to(DynamicTypeGridCellScheduleActionsSelect).inSingletonScope()
container.bind(serviceIds['DynamicTypes/GridCell/VersionsIdSelect']).to(DynamicTypeGridCellVersionIdSelect).inSingletonScope()
container.bind(serviceIds['DynamicTypes/GridCell/AssetVersionPreviewFieldLabel']).to(DynamicTypeGridCellAssetVersionPreviewFieldLabel).inSingletonScope()
container.bind(serviceIds['DynamicTypes/GridCell/Asset']).to(DynamicTypeGridCellAsset).inSingletonScope()
container.bind(serviceIds['DynamicTypes/GridCell/Object']).to(DynamicTypeGridCellObject).inSingletonScope()
container.bind(serviceIds['DynamicTypes/GridCell/Document']).to(DynamicTypeGridCellDocument).inSingletonScope()
container.bind(serviceIds['DynamicTypes/GridCell/LanguageSelect']).to(DynamicTypeGridCellLanguageSelect).inSingletonScope()

// dynamic types listing
container.bind(serviceIds['DynamicTypes/ListingRegistry']).to(DynamicTypeListingRegistry).inSingletonScope()
Expand Down
5 changes: 4 additions & 1 deletion assets/js/src/core/app/config/services/service-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const serviceIds = {
'Asset/Editor/AudioTabManager': 'Asset/Editor/AudioTabManager',
'Asset/Editor/ArchiveTabManager': 'Asset/Editor/ArchiveTabManager',
'Asset/Editor/UnknownTabManager': 'Asset/Editor/UnknownTabManager',
'Asset/MetadataTypeProvider/MetadataTypeRegistry': 'Asset/MetadataTypeProvider/MetadataTypeRegistry',

// Data Objects
'DataObject/Editor/TypeRegistry': 'DataObject/Editor/TypeRegistry',
Expand Down Expand Up @@ -77,6 +76,10 @@ export const serviceIds = {
'DynamicTypes/GridCell/ScheduleActionsSelect': 'DynamicTypes/GridCell/ScheduleActionsSelect',
'DynamicTypes/GridCell/VersionsIdSelect': 'DynamicTypes/GridCell/VersionsIdSelect',
'DynamicTypes/GridCell/AssetVersionPreviewFieldLabel': 'DynamicTypes/GridCell/AssetVersionPreviewFieldLabel',
'DynamicTypes/GridCell/Asset': 'DynamicTypes/GridCell/Asset',
'DynamicTypes/GridCell/Object': 'DynamicTypes/GridCell/Object',
'DynamicTypes/GridCell/Document': 'DynamicTypes/GridCell/Document',
'DynamicTypes/GridCell/LanguageSelect': 'DynamicTypes/GridCell/LanguageSelect',

'DynamicTypes/Listing/Text': 'DynamicTypes/Listing/Text',
'DynamicTypes/Listing/Select': 'DynamicTypes/Listing/Select',
Expand Down
3 changes: 1 addition & 2 deletions assets/js/src/core/app/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
*/

import { type Reducer, combineSlices, configureStore } from '@reduxjs/toolkit'
import { type Reducer, combineSlices, configureStore, type CombinedSliceReducer } from '@reduxjs/toolkit'
import { type TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import { api as pimcoreApi } from '@Pimcore/app/api/pimcore'
import { type CombinedSliceReducer } from '@reduxjs/toolkit/dist/combineSlices'

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface LazyloadedSlices {};
Expand Down
15 changes: 6 additions & 9 deletions assets/js/src/core/components/breadcrumb/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
*/

import React, { useEffect, useRef, useState, type ReactElement, type CSSProperties } from 'react'
import { Breadcrumb as AntBreadcrumb, type BreadcrumbProps as AntBreadcrumbProps } from 'antd'
import { Breadcrumb as AntBreadcrumb, type MenuItemProps, type BreadcrumbProps as AntBreadcrumbProps } from 'antd'
import { type BreadcrumbItemType, type ItemType } from 'antd/es/breadcrumb/Breadcrumb'
import { type MenuItemType } from 'antd/es/menu/hooks/useItems'
import cn from 'classnames'
import { useAppDispatch } from '@Pimcore/app/store'
import { api as elementApi } from '@Pimcore/modules/element/element-api-slice.gen'
Expand Down Expand Up @@ -89,7 +88,7 @@ export const Breadcrumb = ({ path, elementType, editorTabsWidth, pageSize }: Bre
)

// Prepend the "..." menu to the existing items array
const addDotsMenu = ({ dotsMenuItems, items }: { dotsMenuItems: MenuItemType[], items: BreadcrumbItemType[] }): ItemType[] => [
const addDotsMenu = ({ dotsMenuItems, items }: { dotsMenuItems: MenuItemProps[], items: BreadcrumbItemType[] }): ItemType[] => [
{
title: '...',
menu: { items: dotsMenuItems, className: styles.dropdownMenu }
Expand All @@ -107,11 +106,10 @@ export const Breadcrumb = ({ path, elementType, editorTabsWidth, pageSize }: Bre
})

if (partListAmount > 3) {
const dotsMenuItems: MenuItemType[] = []
const dotsMenuItems: MenuItemProps[] = []
for (let i = 1; i < partListAmount - 2; i++) {
dotsMenuItems.push({
key: i,
label: (
title: (
partList[i]
),
onClick: () => {
Expand All @@ -125,12 +123,11 @@ export const Breadcrumb = ({ path, elementType, editorTabsWidth, pageSize }: Bre
}

if (partListAmount > 2 && pageSize !== 'L') {
const dotsMenuItems: MenuItemType[] = []
const dotsMenuItems: MenuItemProps[] = []

for (let i = 1; i < partListAmount; i++) {
dotsMenuItems.push({
key: i,
label: (
title: (
partList[i]
),
onClick: () => {
Expand Down
13 changes: 9 additions & 4 deletions assets/js/src/core/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

import React, { type ReactNode, type Ref } from 'react'
import { type DropdownProps as AntdDropdownProps, type MenuProps, type MenuRef } from 'antd'
import {
type MenuItemType as AntdMenuType,
type SubMenuType as AntdSubMenuType

} from 'antd/es/menu/interface'
import { DropdownInner } from './dropdown-inner'
import { SelectionProvider, SelectionType } from './selection/selection-provider'
import { useStyle } from './dropdown.styles'
Expand All @@ -23,11 +28,11 @@ export type OldMenuItemGroupType = Extract<OldItemType, { type: 'group' }>
export type OldSubMenuType = Extract<OldItemType, { children: OldItemType[] }>
export type MenuDividerType = Extract<OldItemType, { type: 'divider' }>

export interface MenuItemType extends OldMenuItemType {
export interface MenuItemType extends AntdMenuType {
selectable?: boolean
}

export interface SubMenuItemType extends Omit<OldSubMenuType, 'children'> {
export interface SubMenuItemType extends Omit<AntdSubMenuType, 'children'> {
children: ItemType[]
}

Expand All @@ -41,13 +46,13 @@ export interface MenuItemCustomType extends Pick<MenuItemType, 'key'> {
hidden?: boolean
}

export type ItemType = MenuItemType | MenuItemGroupType | SubMenuItemType | MenuDividerType | MenuItemCustomType
export type ItemType<T extends MenuItemType = MenuItemType> = T | MenuItemGroupType | SubMenuItemType | MenuDividerType | MenuItemCustomType | null

export interface DropdownMenuProps extends Omit<MenuProps, 'items'> {
items?: ItemType[]
}

export interface DropdownProps extends Omit<AntdDropdownProps, 'dropdownRender'> {
export interface DropdownProps extends Omit<AntdDropdownProps, 'dropdownRender' | 'menu'> {
menu: DropdownMenuProps
menuRef?: Ref<MenuRef>
selectedKeys?: React.Key[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const WithExtendedApi = (Component: typeof Menu.ItemGroup): ComponentType
const { styles } = useStyles()

return (
// @ts-expect-error ref is incompatible due to wrong typing in antd
<Component
title={ label }
{ ...props }
Expand Down
9 changes: 3 additions & 6 deletions assets/js/src/core/components/grid/columns/default-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
*/

import React, { type ComponentType, useEffect, useMemo, useRef, useState } from 'react'
import { TextCell } from './types/text/text-cell'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import { EditableCellContextProvider } from '../edit-mode/editable-cell-context'
import { useStyle } from './default-cell.styles'
// import { useInjection } from '@Pimcore/app/depency-injection'
Expand All @@ -25,11 +24,9 @@ import { usePrevious } from '@Pimcore/utils/hooks/use-previous'
import { type ExtendedCellContext } from '../grid'
import { useDynamicTypeResolver } from '@Pimcore/modules/element/dynamic-types/resolver/hooks/use-dynamic-type-resolver'

export interface DefaultCellProps extends ExtendedCellContext {
fallbackType?: ComponentType<DefaultCellProps>
}
export interface DefaultCellProps extends ExtendedCellContext {}

export const DefaultCell = ({ fallbackType = TextCell, ...props }: DefaultCellProps): React.JSX.Element => {
export const DefaultCell = ({ ...props }: DefaultCellProps): React.JSX.Element => {
const { styles } = useStyle()
const { column, table, row } = props
const [isEditable, setIsEditable] = useState(column.columnDef.meta?.editable ?? false)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ced4645

Please sign in to comment.