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: Rename Parameters -> LegacyParameters
  • Loading branch information
grebaldi committed Jun 28, 2024
commit 0431bdf53580ddcfd09286792fc777e5836e11d5
4 changes: 2 additions & 2 deletions packages/neos-ui-i18n/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Parameters, i18nRegistry} from './registry';
import {LegacyParameters, i18nRegistry} from './registry';

export {initializeI18n, setupI18n, teardownI18n} from './global';

Expand All @@ -19,7 +19,7 @@ interface I18nProps {
sourceName?: string;

// Additional parameters which are passed to the i18n service.
params?: Parameters;
params?: LegacyParameters;

// Optional className which gets added to the translation span.
className?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/neos-ui-i18n/src/model/Translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* source code.
*/

import type {Parameters} from '../registry/Parameters';
import type {LegacyParameters} from '../registry/Parameters';
import {substitutePlaceholders} from '../registry/substitutePlaceholders';

import {Locale} from './Locale';
Expand All @@ -34,7 +34,7 @@ export class Translation {
private static fromString = (locale: Locale, string: string): Translation =>
new Translation(locale, [string]);

public render(parameters: undefined | Parameters, quantity: number): string {
public render(parameters: undefined | LegacyParameters, quantity: number): string {
return parameters
? substitutePlaceholders(this.byQuantity(quantity), parameters)
: this.byQuantity(quantity);
Expand Down
20 changes: 10 additions & 10 deletions packages/neos-ui-i18n/src/registry/I18nRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {requireGlobals} from '../global';
import type {Translation, TranslationAddress} from '../model';

import {getTranslationAddress} from './getTranslationAddress';
import type {Parameters} from './Parameters';
import type {LegacyParameters} from './LegacyParameters';

const errorCache: Record<string, boolean> = {};

Expand Down Expand Up @@ -69,12 +69,12 @@ export class I18nRegistry extends SynchronousRegistry<unknown> {
*
* @param {string} transUnitIdOrFullyQualifiedTranslationAddress The fully qualified translation address, that follows the format "{Package.Key:SourceName:trans.unit.id}"
* @param {undefined|string} fallback The string that shall be displayed, when no translation string could be found.
* @param {Parameters} parameters The values to replace substitution placeholders with in the translation string
* @param {LegacyParameters} parameters The values to replace substitution placeholders with in the translation string
*/
translate(
transUnitIdOrFullyQualifiedTranslationAddress: string,
fallback: undefined | string,
parameters: Parameters
parameters: LegacyParameters
): string;

/**
Expand All @@ -93,13 +93,13 @@ export class I18nRegistry extends SynchronousRegistry<unknown> {
*
* @param {string} transUnitId The trans-unit id
* @param {undefined|string} fallback The string that shall be displayed, when no translation string could be found.
* @param {Parameters} parameters The values to replace substitution placeholders with in the translation string
* @param {LegacyParameters} parameters The values to replace substitution placeholders with in the translation string
* @param {string} packageKey The key of the package in which to look for the translation file
*/
translate(
transUnitId: string,
fallback: undefined | string,
parameters: undefined | Parameters,
parameters: undefined | LegacyParameters,
packageKey: string
): string;

Expand All @@ -120,14 +120,14 @@ export class I18nRegistry extends SynchronousRegistry<unknown> {
*
* @param {string} transUnitId The trans-unit id
* @param {undefined|string} fallback The string that shall be displayed, when no translation string could be found.
* @param {Parameters} parameters The values to replace substitution placeholders with in the translation string
* @param {LegacyParameters} parameters The values to replace substitution placeholders with in the translation string
* @param {string} packageKey The key of the package in which to look for the translation file
* @param {string} sourceName The name of the translation file in that package's resource translations
*/
translate(
transUnitId: string,
fallback: undefined | string,
parameters: undefined | Parameters,
parameters: undefined | LegacyParameters,
packageKey: string,
sourceName: string
): string;
Expand All @@ -153,14 +153,14 @@ export class I18nRegistry extends SynchronousRegistry<unknown> {
*
* @param {string} transUnitId The trans-unit id
* @param {undefined|string} fallback The string that shall be displayed, when no translation string could be found.
* @param {Parameters} parameters The values to replace substitution placeholders with in the translation string
* @param {LegacyParameters} parameters The values to replace substitution placeholders with in the translation string
* @param {string} packageKey The key of the package in which to look for the translation file
* @param {string} sourceName The name of the translation file in that package's resource translations
*/
translate(
transUnitId: string,
fallback: undefined | string,
parameters: undefined | Parameters,
parameters: undefined | LegacyParameters,
packageKey: string,
sourceName: string,
quantity: number
Expand All @@ -169,7 +169,7 @@ export class I18nRegistry extends SynchronousRegistry<unknown> {
translate(
transUnitIdOrFullyQualifiedTranslationAddress: string,
explicitlyProvidedFallback?: string,
parameters?: Parameters,
parameters?: LegacyParameters,
explicitlyProvidedPackageKey: string = 'Neos.Neos',
explicitlyProvidedSourceName: string = 'Main',
quantity: number = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* information, please view the LICENSE file which was distributed with this
* source code.
*/
export type Parameters = unknown[] | Record<string, unknown>;
export type LegacyParameters = unknown[] | Record<string, unknown>;
2 changes: 1 addition & 1 deletion packages/neos-ui-i18n/src/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
export type {I18nRegistry} from './I18nRegistry';
export {i18nRegistry} from './I18nRegistry';

export type {Parameters} from './Parameters';
export type {LegacyParameters} from './LegacyParameters';

export {substitutePlaceholders} from './substitutePlaceholders';
4 changes: 2 additions & 2 deletions packages/neos-ui-i18n/src/registry/substitutePlaceholders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
*/
import logger from '@neos-project/utils-logger';

import {Parameters} from './Parameters';
import {LegacyParameters} from './LegacyParameters';

/**
* This code is taken from the Ember version with minor adjustments. Possibly refactor it later
* as its style is not superb.
*/
export const substitutePlaceholders = function (textWithPlaceholders: string, parameters: Parameters) {
export const substitutePlaceholders = function (textWithPlaceholders: string, parameters: LegacyParameters) {
const result = [];
let startOfPlaceholder;
let offset = 0;
Expand Down