-
Notifications
You must be signed in to change notification settings - Fork 18
Implement emails tab
#2842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Implement emails tab
#2842
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
ecd10ab
improved email tab
Corepex 63e4736
changed properties
Corepex 91052e1
added `tooltip` prop to `iconButton`
Corepex 70ea6bf
added translations
Corepex 20a42af
added tooltips to buttons
Corepex 1fe8e5f
added sdk exports
Corepex 087fcc5
added type column
Corepex d3b9c55
disable html and parameters button if thers none
Corepex a113f73
added enhanced caching
Corepex 149e370
added variant icon
Corepex 689175b
added tooltip translations
Corepex aa2dda7
added linter fixes
Corepex e3a8a3f
improved `ElementSubtypeIconCell` logic
Corepex 9de346b
Apply eslint-fixer changes
Corepex d7336fd
Automatic frontend build
Corepex e64474b
removed weird logic
Corepex 82047de
Apply eslint-fixer changes
Corepex 27452c1
Automatic frontend build
Corepex ffb5e2c
improved tooltip
Corepex 934bd7b
Automatic frontend build
Corepex 69a41eb
changed icon color
Corepex 59dd821
replaced strings with enum
Corepex a9fb398
Merge remote-tracking branch 'origin/gdpr-add-emails-tab' into gdpr-a…
Corepex c3ea8f6
fixed id column bug
Corepex d546890
Apply eslint-fixer changes
Corepex 468a30c
Automatic frontend build
Corepex 1578e2d
fixed sorting issue
Corepex fae5178
fixed imports
Corepex 9c07edd
Apply eslint-fixer changes
Corepex 37a361f
Automatic frontend build
Corepex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...itions/grid-cell/components/element-subtype-icon-cell/element-subtype-icon-cell.styles.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * This source file is available under the terms of the | ||
| * Pimcore Open Core License (POCL) | ||
| * Full copyright and license information is available in | ||
| * LICENSE.md which is distributed with this source code. | ||
| * | ||
| * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) | ||
| * @license Pimcore Open Core License (POCL) | ||
| */ | ||
|
|
||
| import { createStyles } from 'antd-style' | ||
|
|
||
| export const useStyle = createStyles(({ token, css }) => { | ||
| return { | ||
| cell: css` | ||
| .pimcore-icon { | ||
| color: ${token.Colors.Neutral.Icon.colorIcon}; | ||
| } | ||
| ` | ||
| } | ||
| }) |
66 changes: 66 additions & 0 deletions
66
.../definitions/grid-cell/components/element-subtype-icon-cell/element-subtype-icon-cell.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /** | ||
| * This source file is available under the terms of the | ||
| * Pimcore Open Core License (POCL) | ||
| * Full copyright and license information is available in | ||
| * LICENSE.md which is distributed with this source code. | ||
| * | ||
| * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) | ||
| * @license Pimcore Open Core License (POCL) | ||
| */ | ||
|
|
||
| import { type DefaultCellProps } from '@Pimcore/components/grid/columns/default-cell' | ||
| import { IconView } from '@Pimcore/components/grid/columns/views/icon/icon-view' | ||
| import { Tooltip } from '@Pimcore/components/tooltip/tooltip' | ||
| import { type ElementType } from '@Pimcore/types/enums/element/element-type' | ||
| import { capitalize } from 'lodash' | ||
| import React from 'react' | ||
| import { useStyle } from './element-subtype-icon-cell.styles' | ||
|
|
||
| export interface ElementSubtypeIconCellProps extends DefaultCellProps { | ||
| elementType: ElementType | ||
| } | ||
|
|
||
| export const ElementSubtypeIconCell = (props: ElementSubtypeIconCellProps): React.JSX.Element => { | ||
| const { styles } = useStyle() | ||
| const subtype = props.getValue() ?? props.row.original.subType | ||
|
|
||
| function renderCell (): React.JSX.Element { | ||
| switch (subtype) { | ||
| case 'image': | ||
| return <IconView value={ 'image' } /> | ||
| case 'video': | ||
| return <IconView value={ 'video' } /> | ||
| case 'audio': | ||
| return <IconView value={ 'audio' } /> | ||
| case 'document': | ||
| return <IconView value={ 'document' } /> | ||
| case 'archive': | ||
| case 'folder': | ||
| return <IconView value={ 'folder' } /> | ||
| case 'page': | ||
| return <IconView value={ 'file' } /> | ||
| case 'snippet': | ||
| return <IconView value={ 'snippet' } /> | ||
| case 'email': | ||
| return <IconView value={ 'mail' } /> | ||
| case 'link': | ||
| return <IconView value={ 'hardlink' } /> | ||
| case 'object': | ||
| case 'dataObject': | ||
| case 'data-object': | ||
| return <IconView value={ 'data-object' } /> | ||
| case 'variant': | ||
| return <IconView value={ 'data-object-variant' } /> | ||
| default: | ||
| return <IconView value={ props.elementType } /> | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <div className={ styles.cell }> | ||
| <Tooltip title={ capitalize(String(subtype)) }> | ||
| {renderCell()} | ||
| </Tooltip> | ||
| </div > | ||
| ) | ||
| } |
39 changes: 39 additions & 0 deletions
39
...ions/grid-cell/types/element-subtype-icon/dynamic-type-grid-cell-element-subtype-icon.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /** | ||
| * This source file is available under the terms of the | ||
| * Pimcore Open Core License (POCL) | ||
| * Full copyright and license information is available in | ||
| * LICENSE.md which is distributed with this source code. | ||
| * | ||
| * @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com) | ||
| * @license Pimcore Open Core License (POCL) | ||
| */ | ||
|
|
||
| import React, { type ReactElement } from 'react' | ||
| import { type AbstractGridCellDefinition, DynamicTypeGridCellAbstract } from '../../dynamic-type-grid-cell-abstract' | ||
| import { injectable } from 'inversify' | ||
| import { ElementSubtypeIconCell, type ElementSubtypeIconCellProps } from '../../components/element-subtype-icon-cell/element-subtype-icon-cell' | ||
| import { type ElementType } from '@Pimcore/types/enums/element/element-type' | ||
|
|
||
| export interface ElementSubtypeIconGridCellConfig { | ||
| elementType: ElementType | ||
| } | ||
|
|
||
| @injectable() | ||
| export class DynamicTypeGridCellElementSubtypeIcon extends DynamicTypeGridCellAbstract { | ||
| readonly id = 'element-subtype-icon' | ||
|
|
||
| getGridCellComponent (props: AbstractGridCellDefinition): ReactElement<AbstractGridCellDefinition> { | ||
| const config = props.column.columnDef.meta?.config as ElementSubtypeIconGridCellConfig | undefined | ||
|
|
||
| if (config?.elementType === undefined) { | ||
| throw new Error('ElementSubtypeIconCell requires elementType in column meta config') | ||
| } | ||
|
|
||
| const cellProps: ElementSubtypeIconCellProps = { | ||
| ...props, | ||
| elementType: config.elementType | ||
| } | ||
|
|
||
| return <ElementSubtypeIconCell { ...cellProps } /> | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better in the slice - enhanced ticket created #2848