Skip to content

Commit

Permalink
Merge branch '1.x' into navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
sholzer committed Dec 3, 2024
2 parents 20dbee7 + 727f2c7 commit 5f2d5bb
Show file tree
Hide file tree
Showing 41 changed files with 1,957 additions and 1,920 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const useStyles = createStyles(({ token, css }) => {
> .ant-collapse-header {
display: inline-flex;
width: 100%;
align-items: center;
align-items: baseline;
> .ant-collapse-header-text {
margin-inline-end: 0;
Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/core/components/accordion/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const Accordion = ({
role={ 'button' }
size="small"
type={ 'text' }
variant='minimal'
/>
)
}
Expand All @@ -107,8 +108,7 @@ export const Accordion = ({
className: itemClassNames.join(' '),
label: <>
<Flex
align={ 'center' }
vertical={ false }
align={ 'baseline' }
>
{expandIconPosition === 'start' && (item.children !== null) && !(item.disabled === true) &&
chevronButton()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { Box } from '../box/box'

export interface TreeSearchProps {
node: TreeNodeProps
isLoading?: boolean
mergeAdditionalQueryParams?: Dispatch<unknown>
total: number
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const TreeList = ({ node }: TreeListProps): React.JSX.Element => {
const { isLoading, isFetching, isError, data } = apiHookResult
const { uploadFileList, uploadingNode } = useContext(UploadContext)!

if (isLoading === true || isFetching === true) {
if (isLoading === true) {
return (
<Skeleton style={ { paddingLeft: token.paddingSM + (node.level + 1.5) * 24 } } />
)
Expand All @@ -54,6 +54,7 @@ export const TreeList = ({ node }: TreeListProps): React.JSX.Element => {
style={ { paddingLeft: token.paddingSM + (node.level + 1) * 24 } }
>
<RenderFilter
isLoading={ isFetching }
mergeAdditionalQueryParams={ mergeAdditionalQueryParams }
node={ node }
total={ total }
Expand Down
8 changes: 8 additions & 0 deletions assets/js/src/core/components/select/select.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ export const useStyles = createStyles(({ css, token }, props: StylesProps) => {
}
`,

selectContainerWithClear: css`
&:hover {
.ant-select-arrow {
display: none;
}
}
`,

select: css`
width: ${!isEmptyValue(props.width) ? `${props.width}px` : 'initial'};
Expand Down
12 changes: 10 additions & 2 deletions assets/js/src/core/components/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ export interface SelectProps extends AntdSelectProps {
width?: number
}

export const Select = forwardRef<RefSelectProps, SelectProps>(({ customIcon, customArrowIcon, mode, status, className, width, ...antdSelectProps }, ref): React.JSX.Element => {
export const Select = forwardRef<RefSelectProps, SelectProps>(({ customIcon, customArrowIcon, mode, status, className, width, allowClear, ...antdSelectProps }, ref): React.JSX.Element => {
const selectRef = useRef<RefSelectProps>(null)

const [isActive, setIsActive] = useState(false)
const [isFocus, setIsFocus] = useState(false)
const [isSelected, setIsSelected] = useState(false)

useImperativeHandle(ref, () => selectRef.current!)

Expand All @@ -41,7 +42,8 @@ export const Select = forwardRef<RefSelectProps, SelectProps>(({ customIcon, cus

const selectContainerClassNames = cn(styles.selectContainer, {
[styles.selectContainerWarning]: isStatusWarning,
[styles.selectContainerError]: isStatusError
[styles.selectContainerError]: isStatusError,
[styles.selectContainerWithClear]: allowClear === true && isSelected
})
const selectClassNames = cn(className, styles.select, {
[styles.selectWithCustomIcon]: withCustomIcon
Expand All @@ -54,6 +56,10 @@ export const Select = forwardRef<RefSelectProps, SelectProps>(({ customIcon, cus

const handleClick = (): void => { setIsActive(!isActive) }

const handleChange = (value: string): void => {
!isEmpty(value) ? setIsSelected(true) : setIsSelected(false)
}

const getSuffixIcon = (): React.JSX.Element => {
const isShowCustomIcon = !isEmpty(customArrowIcon) && isString(customArrowIcon)
const iconToShow = isShowCustomIcon ? customArrowIcon : (isActive ? 'chevron-up' : 'chevron-down')
Expand Down Expand Up @@ -83,10 +89,12 @@ export const Select = forwardRef<RefSelectProps, SelectProps>(({ customIcon, cus
/>
)}
<AntdSelect
allowClear={ allowClear }
className={ selectClassNames }
menuItemSelectedIcon={ getItemSelectedIcon() }
mode={ mode }
onBlur={ () => { setIsFocus(false) } }
onChange={ handleChange }
onDropdownVisibleChange={ handleClick }
onFocus={ () => { setIsFocus(true) } }
ref={ selectRef }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const SearchContainer = (props: TreeSearchProps): React.JSX.Element => {
const { t } = useTranslation()
return (
<BaseSearchContainer
{ ...props }
label={ t('asset.asset-tree.search', { folderName: props.node.label }) }
node={ props.node }
total={ props.total }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const SearchContainer = (props: TreeSearchProps): React.JSX.Element => {
const { t } = useTranslation()
return (
<BaseSearchContainer
{ ...props }
label={ t('data-object.data-object-tree.search', { folderName: props.node.label }) }
node={ props.node }
total={ props.total }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { Flex } from '@Pimcore/components/flex/flex'
import { Space } from '@Pimcore/components/space/space'
import { Tag } from '@Pimcore/components/tag/tag'
import { useTranslation } from 'react-i18next'
import { Box } from '@Pimcore/components/box/box'

interface VersionIdentifiers {
id: number
Expand Down Expand Up @@ -82,12 +83,18 @@ export const createVersionAccordionItem = ({
return (
<div>
{selectable && (
<Checkbox
checked={ selected }
onChange={ () => {
selectVersion(vId)
} }
/>
<Box
inline
padding={ { right: 'extra-small' } }
>
<Checkbox
checked={ selected }
onChange={ () => {
selectVersion(vId)
} }
/>
</Box>

)}
<span className={ 'title' }>
{`${t('version.version')} ${version.versionCount} | ${formatDateTime({
Expand Down Expand Up @@ -115,15 +122,17 @@ export const createVersionAccordionItem = ({

const Extra = (): React.JSX.Element => {
const { t } = useTranslation()
const color = published ? 'success' : 'blue'
const icon = published ? 'world' : 'user'

if (!published) {
return <></>
}

return (
<Tag
color={ color }
iconName={ icon }
color={ 'success' }
iconName={ 'world' }
>
{ published ? t('version.published') : t('version.own-draft') }
{t('version.published')}
</Tag>
)
}
Expand Down Expand Up @@ -151,7 +160,7 @@ export const createVersionAccordionItem = ({
vertical
>
<Flex
align='center'
align='top'
justify='space-between'
>
<Tag className={ 'id-tag' }>ID: {version.id}</Tag>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,11 @@ export const api = baseApi.enhanceEndpoints({
})

export type * from './version-api-slice.gen'
export const { useVersionAssetDownloadByIdQuery, useVersionCleanupForElementByTypeAndIdMutation, useVersionDeleteByIdMutation, useVersionGetByIdQuery, useVersionGetCollectionForElementByTypeAndIdQuery, useVersionPublishByIdMutation, useVersionUpdateByIdMutation } = api
export const {
useVersionAssetDownloadByIdQuery,
useVersionCleanupForElementByTypeAndIdMutation,
useVersionDeleteByIdMutation, useVersionGetByIdQuery,
useVersionGetCollectionForElementByTypeAndIdQuery,
useVersionPublishByIdMutation,
useVersionUpdateByIdMutation
} = api
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const SearchContainer = (props: SearchContainerProps): React.JSX.Element => {
return (
<Search
aria-label={ props.label }
loading={ props.isLoading }
onSearch={ onSearch }
placeholder={ props.label }
size='small'
Expand Down
2 changes: 0 additions & 2 deletions public/build/40972777-fea1-4122-a636-599673f368d1/core-dll.js

This file was deleted.

12 changes: 0 additions & 12 deletions public/build/40972777-fea1-4122-a636-599673f368d1/entrypoints.json

This file was deleted.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/build/69610f6d-d9b8-4bf0-9eb5-332ac89fe1e2/core-dll.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions public/build/69610f6d-d9b8-4bf0-9eb5-332ac89fe1e2/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entrypoints": {
"core-dll": {
"css": [
"/bundles/pimcorestudioui/build/69610f6d-d9b8-4bf0-9eb5-332ac89fe1e2/core-dll.css"
],
"js": [
"/bundles/pimcorestudioui/build/69610f6d-d9b8-4bf0-9eb5-332ac89fe1e2/core-dll.js"
]
}
}
}
Loading

0 comments on commit 5f2d5bb

Please sign in to comment.