Skip to content

Commit

Permalink
Fix behavior of version accordions
Browse files Browse the repository at this point in the history
  • Loading branch information
vin0401 committed Dec 3, 2024
1 parent 6011f42 commit 9dd1072
Show file tree
Hide file tree
Showing 30 changed files with 1,900 additions and 2,419 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 @@ -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
14 changes: 14 additions & 0 deletions public/build/2eddae9d-bb1e-4618-a932-83576b82b749/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"entrypoints": {
"main": {
"css": [
"http://localhost:3030/build/2eddae9d-bb1e-4618-a932-83576b82b749/vendors-node_modules_dnd-kit_modifiers_dist_modifiers_esm_js-node_modules_dnd-kit_sortable_di-41eabe.css",
"http://localhost:3030/build/2eddae9d-bb1e-4618-a932-83576b82b749/main.css"
],
"js": [
"http://localhost:3030/build/2eddae9d-bb1e-4618-a932-83576b82b749/vendors-node_modules_dnd-kit_modifiers_dist_modifiers_esm_js-node_modules_dnd-kit_sortable_di-41eabe.js",
"http://localhost:3030/build/2eddae9d-bb1e-4618-a932-83576b82b749/main.js"
]
}
}
}
1,854 changes: 1,854 additions & 0 deletions public/build/2eddae9d-bb1e-4618-a932-83576b82b749/manifest.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions public/build/7a5a3da8-fc30-4a5f-9b07-d4c2da1fe547/105.js

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions public/build/7a5a3da8-fc30-4a5f-9b07-d4c2da1fe547/core-dll.css

This file was deleted.

2 changes: 0 additions & 2 deletions public/build/7a5a3da8-fc30-4a5f-9b07-d4c2da1fe547/core-dll.js

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions public/build/7a5a3da8-fc30-4a5f-9b07-d4c2da1fe547/entrypoints.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 9dd1072

Please sign in to comment.