Skip to content

Commit

Permalink
merged changed from the main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeriaMaltseva committed Dec 3, 2024
2 parents a30df1b + 4790015 commit 0c1734b
Show file tree
Hide file tree
Showing 59 changed files with 4,886 additions and 19 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 @@ -47,6 +47,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: 2 additions & 0 deletions public/build/0a1a0a5f-e169-4c5b-b107-1591f630254f/105.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*!
*
* /**
* * Pimcore
* *
* * This source file is available under two different licenses:
* * - Pimcore Open Core License (POCL)
* * - Pimcore Commercial License (PCL)
* * Full copyright and license information is available in
* * LICENSE.md which is distributed with this source code.
* *
* * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* * @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
* * /
*
*/
16 changes: 16 additions & 0 deletions public/build/0a1a0a5f-e169-4c5b-b107-1591f630254f/core-dll.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/build/0a1a0a5f-e169-4c5b-b107-1591f630254f/core-dll.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/* @preserve
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/

/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/

/*!
*
* /**
* * Pimcore
* *
* * This source file is available under two different licenses:
* * - Pimcore Open Core License (POCL)
* * - Pimcore Commercial License (PCL)
* * Full copyright and license information is available in
* * LICENSE.md which is distributed with this source code.
* *
* * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* * @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
* * /
*
*/

/*! @license DOMPurify 3.2.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.1/LICENSE */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/**
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* use-sync-external-store-with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @remix-run/router v1.21.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router DOM v6.28.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router v6.28.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* Pimcore
*
* This source file is available under two different licenses:
* - Pimcore Open Core License (POCL)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
*/
12 changes: 12 additions & 0 deletions public/build/0a1a0a5f-e169-4c5b-b107-1591f630254f/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entrypoints": {
"core-dll": {
"css": [
"/bundles/pimcorestudioui/build/0a1a0a5f-e169-4c5b-b107-1591f630254f/core-dll.css"
],
"js": [
"/bundles/pimcorestudioui/build/0a1a0a5f-e169-4c5b-b107-1591f630254f/core-dll.js"
]
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0c1734b

Please sign in to comment.