Skip to content
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

WIP: Isolate Drawer menu from the rest of the UI #3773

Draft
wants to merge 71 commits into
base: 9.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
a9b33d1
TASK: Convert FlashMessage component to typescript
grebaldi May 30, 2024
10068f1
TASK: Convert FlashMessages component to typescript
grebaldi May 31, 2024
28f91a3
TASK: Move ErrorView component into ./container/ directory
grebaldi May 31, 2024
57af79b
TASK: Move ErrorBoundary component to neos-ui-error package
grebaldi May 31, 2024
492f0cd
TASK: Move function `terminateDueToFatalInitializationError` to neos-…
grebaldi May 31, 2024
7cd6b2d
TASK: Move component FlashMessages to neos-ui-error package
grebaldi May 31, 2024
2538b85
TASK: Add package `@neos-project/framework-observable`
grebaldi May 31, 2024
3a9090e
TASK: Add package `@neos-project/framework-observable-react`
grebaldi May 31, 2024
ff458b6
TASK: Decouple FlashMessage from redux store
grebaldi May 31, 2024
2258a0b
!!!TASK: Delete obsolete redux-store elements for flash messages
grebaldi Jun 6, 2024
2caf38a
TASK: Replace all calls to `action.UI.FlashMessages.add` with new `sh…
grebaldi Jun 6, 2024
8823c4f
TASK: Implement `TranslationAddress` value object
grebaldi Jun 14, 2024
1c714e9
TASK: Extract function `getTranslationAddress`
grebaldi Jun 14, 2024
9cf40bd
TASK: Extract function `substitutePlaceholders`
grebaldi Jun 14, 2024
76614b5
TASK: Extract function `getPluralForm`
grebaldi Jun 17, 2024
c5f98b4
TASK: Convert I18nRegistry to typescript
grebaldi Jun 17, 2024
c3d5300
TASK: Return actual TranslationAddress from `getTranslationAddress`
grebaldi Jun 17, 2024
fa66f2a
TASK: Introduce TranslationUnitRepository
grebaldi Jun 17, 2024
d35af00
TASK: Preserve fully qualified translation address
grebaldi Jun 17, 2024
f579a54
TASK: Fix misnomer f.q. trans-unit id -> f.q. translation address
grebaldi Jun 17, 2024
99179ad
TASK: Use TranslationUnitRepository for translation lookup in I18nReg…
grebaldi Jun 17, 2024
0f6fde3
TASK: Rename TranslationUnit -> TranslationUnitDTO
grebaldi Jun 17, 2024
6b839e0
TASK: Introduce TranslationUnit value object
grebaldi Jun 17, 2024
eac4a03
TASK: Integrate TranslationUnit with I18nRegistry
grebaldi Jun 17, 2024
fc046ea
TASK: Remove obsolete function `getPluralForm`
grebaldi Jun 17, 2024
ed34e6a
TASK: Convert neos-ui-i18n/src/registry/I18nRegistry.spec.js to TypeS…
grebaldi Jun 17, 2024
339684d
TASK: Turn `I18nRegistry` into a singleton
grebaldi Jun 17, 2024
3c94d1e
TASK: Make <I18n> component independent from global registry
grebaldi Jun 17, 2024
b60daf3
TASK: Expose I18nRegistry through i18n package rather than neos-ts-in…
grebaldi Jun 17, 2024
2d6e743
TASK: Convert neos-ui-i18n/index.spec.js to TypeScript
grebaldi Jun 17, 2024
7a06dea
TASK: Rename `TranslationUnit` -> `Translation`
grebaldi Jun 18, 2024
5ecfb4f
TASK: Expose function `registerTranslations` from @neos-project/neos-…
grebaldi Jun 18, 2024
6da83b4
TASK: Discover translations endpoint via <link>-tag
grebaldi Jun 19, 2024
9375354
TASK: Introduce Locale & PluralRule models
grebaldi Jun 25, 2024
e6716fb
TASK: Expose `registerLocale` and use it in bootstrap process
grebaldi Jun 25, 2024
61168df
!!!BUGFIX: Use Intl plurals for proper plural form determination
grebaldi Jun 25, 2024
497a345
FEATURE: Implement and expose API `translate` function
grebaldi Jun 26, 2024
77dfdda
TASK: Centralize setup of globals for @neos-project/neos-ui-i18n
grebaldi Jun 26, 2024
f5eb665
TASK: Implement, expose and use `initializeI18n`
grebaldi Jun 27, 2024
5278b3e
TASK: Move `Translation` into `model` module
grebaldi Jun 27, 2024
047a39f
TASK: Move `TranslationAddress` into `model` module
grebaldi Jun 27, 2024
16f3efb
TASK: Move `TranslationRepository` into `model` module
grebaldi Jun 27, 2024
0431bdf
TASK: Rename `Parameters` -> `LegacyParameters`
grebaldi Jun 27, 2024
1ac7864
TASK: Introduce proper `Parameters` type
grebaldi Jun 27, 2024
c567182
TASK: Move `<I18n/>`-component into separate module
grebaldi Jun 28, 2024
a875f9a
TASK: Deprecate `I18nRegistry.translate`
grebaldi Jun 28, 2024
6c2fd85
TASK: Deprecate `I18nRegistry`
grebaldi Jun 28, 2024
9f46e0a
TASK: Deprecate `<I18n/>`-component
grebaldi Jun 28, 2024
232e6a8
TASK: Add documentation for `@neos-project/neos-ui-i18n` package
grebaldi Jun 28, 2024
4131c8a
Merge remote-tracking branch 'upstream/task/centralize-error-handling…
grebaldi Jul 5, 2024
15c94f3
Merge remote-tracking branch 'upstream/task/centralize-i18n' into tem…
grebaldi Jul 5, 2024
26cebfe
!!!TASK: Split `user` key from `initialData` via separate `UserProvider`
grebaldi Apr 30, 2024
1d5f669
TASK: Convert `<UserImage/>` container to typescript
grebaldi Apr 30, 2024
916059f
TASK: Convert `<RestoreButtonItem/>` container to typescript
grebaldi Apr 30, 2024
437fa07
TASK: Convert `<UserDropDown/>` container to typescript
grebaldi Apr 30, 2024
0d83a02
PATCH: Fix typing in UserProviderInterface
grebaldi May 21, 2024
91a8f8b
TASK: Convert parsing of initial data to Typescript
grebaldi May 21, 2024
23511f4
TASK: Make `alias`optional in `initializeJsAPI`
grebaldi May 21, 2024
5691af5
TASK: Detach user menu from redux store
grebaldi May 21, 2024
f440199
BUGFIX: Render dropdown contents even when dropdown is closed
grebaldi May 30, 2024
7393f33
TASK: Convert VersionPanel component to typescript
grebaldi May 30, 2024
0da253e
TASK: Convert Drawer/constants to typescript
grebaldi May 30, 2024
393902b
TASK: Convert Drawer/MenuItem component to typescript
grebaldi May 30, 2024
46e8ba0
TASK: Convert Drawer/MenuItemGroup to typescript
grebaldi May 30, 2024
22dcadf
TASK: Convert Drawer component to typescript
grebaldi May 30, 2024
1ef89fd
PATCH: Don't pass user down to Drawer & UserDropDown
grebaldi May 30, 2024
87300fa
PATCH: Move impersonateRestore out of the redux store
grebaldi May 30, 2024
c4a3d71
PATCH: Move impersonateRestore out of the redux store part II
grebaldi Jun 13, 2024
c6b1383
TASK: Remove unused `target` property from drawer menu items
grebaldi Jun 13, 2024
40b2697
TASK: Convert MenuToggler to typescript
grebaldi Jun 14, 2024
ebaf71e
TASK: Decouple Drawer from redux store
grebaldi Jun 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TASK: Convert <UserImage/> container to typescript
  • Loading branch information
grebaldi committed Jul 5, 2024
commit 1d5f669fc9ad1dae110eb52e17729ef9adc67c2c
24 changes: 0 additions & 24 deletions packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js

This file was deleted.

23 changes: 23 additions & 0 deletions packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* This file is part of the Neos.Neos.Ui package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/
import React from 'react';

import style from './style.module.css';

export const UserImage: React.FC<{
userFirstName: string;
userLastName: string;
}> = (props) => {
const userInitials = props.userFirstName?.charAt(0) + props.userLastName?.charAt(0);

return (
<div className={style.user__image}>{userInitials}</div>
);
}
11 changes: 9 additions & 2 deletions packages/neos-ui/src/Containers/Drawer/UserDropDown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ import {connect} from 'react-redux';

import {neos} from '@neos-project/neos-ui-decorators';
import {Icon, DropDown} from '@neos-project/react-ui-components';
import UserImage from './UserImage';
import {UserImage} from './UserImage';
import RestoreButtonItem from './RestoreButtonItem';

import I18n from '@neos-project/neos-ui-i18n';

import style from './style.module.css';
@connect(state => ({
userName: state?.user?.name?.fullName,
userFirstName: state?.user?.name?.firstName,
userLastName: state?.user?.name?.lastName,
impersonateStatus: state?.user?.impersonate?.status
}))
@neos()
export default class UserDropDown extends PureComponent {
static propTypes = {
userName: PropTypes.string.isRequired,
userFirstName: PropTypes.string.isRequired,
userLastName: PropTypes.string.isRequired,
impersonateStatus: PropTypes.bool.isRequired
};

Expand All @@ -29,7 +33,10 @@ export default class UserDropDown extends PureComponent {
<div className={style.wrapper}>
<DropDown className={style.dropDown}>
<DropDown.Header className={style.dropDown__btn}>
<UserImage />
<UserImage
userFirstName={this.props.userFirstName}
userLastName={this.props.userLastName}
/>
<span className={style.dropDown__userName}>{this.props.userName}</span>
</DropDown.Header>
<DropDown.Contents className={style.dropDown__contents}>
Expand Down