Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	changelog.md
  • Loading branch information
AlekseyManetov committed Oct 11, 2024
2 parents 5395934 + d2b1d92 commit b4a7d28
Show file tree
Hide file tree
Showing 25 changed files with 100 additions and 78 deletions.
26 changes: 13 additions & 13 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/app",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM Unified UI landing",
"author": "EPAM",
"license": "MIT",
Expand All @@ -17,19 +17,19 @@
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@elastic/apm-rum": "^5.14.0",
"@epam/assets": "5.9.2",
"@epam/draft-rte": "5.9.2",
"@epam/electric": "5.9.2",
"@epam/assets": "5.9.5",
"@epam/draft-rte": "5.9.5",
"@epam/electric": "5.9.5",
"@epam/internal": "0.0.2",
"@epam/loveship": "5.9.2",
"@epam/promo": "5.9.2",
"@epam/uui": "5.9.2",
"@epam/uui-components": "5.9.2",
"@epam/uui-core": "5.9.2",
"@epam/uui-db": "5.9.2",
"@epam/uui-docs": "5.9.2",
"@epam/uui-editor": "5.9.2",
"@epam/uui-timeline": "5.9.2",
"@epam/loveship": "5.9.5",
"@epam/promo": "5.9.5",
"@epam/uui": "5.9.5",
"@epam/uui-components": "5.9.5",
"@epam/uui-core": "5.9.5",
"@epam/uui-db": "5.9.5",
"@epam/uui-docs": "5.9.5",
"@epam/uui-editor": "5.9.5",
"@epam/uui-timeline": "5.9.5",
"@tanstack/react-query": "^5.17.19",
"@udecode/plate-common": "31.3.2",
"amplitude-js": "8.9.1",
Expand Down
12 changes: 11 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@
* [TabButton][VerticalTabButton]: decreased paddings & gaps for all sizes according to the design

**What's Fixed**
*[VirtualList]: fixed offsets counting if rows have different height
* [VirtualList]: fixed offsets counting if rows have different height


# 5.9.5 - 09.10.2024

**What's Fixed**
* [ArrayDataSource]: fixed initializing caches on data source creation.

# 5.9.4 - 26.09.2024

**What's Fixed**
* [useAsyncDataSource]: fixed refetching of data after deps change.

# 5.9.3 - 16.09.2024

**What's Fixed**
Expand Down
10 changes: 5 additions & 5 deletions draft-rte/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/draft-rte",
"version": "5.9.2",
"version": "5.9.5",
"author": "EPAM",
"license": "MIT",
"main": "index.js",
Expand All @@ -11,10 +11,10 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/assets": "5.9.2",
"@epam/loveship": "5.9.2",
"@epam/uui-components": "5.9.2",
"@epam/uui-core": "5.9.2",
"@epam/assets": "5.9.5",
"@epam/loveship": "5.9.5",
"@epam/uui-components": "5.9.5",
"@epam/uui-core": "5.9.5",
"@types/draft-js": "0.10.23",
"classnames": "^2.2.6",
"draft-convert": "^2.1.2",
Expand Down
2 changes: 1 addition & 1 deletion epam-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/assets",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM Assets Library",
"author": "EPAM",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions epam-electric/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/electric",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM UUI components set branded with 'electric' style",
"author": "EPAM",
"license": "MIT",
Expand All @@ -12,9 +12,9 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/uui": "5.9.2",
"@epam/uui-components": "5.9.2",
"@epam/uui-core": "5.9.2"
"@epam/uui": "5.9.5",
"@epam/uui-components": "5.9.5",
"@epam/uui-core": "5.9.5"
},
"devDependencies": {
"mockdate": "^3.0.5"
Expand Down
10 changes: 5 additions & 5 deletions epam-promo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/promo",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM UUI4 components set",
"author": "EPAM",
"license": "MIT",
Expand All @@ -12,10 +12,10 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/assets": "5.9.2",
"@epam/uui": "5.9.2",
"@epam/uui-components": "5.9.2",
"@epam/uui-core": "5.9.2",
"@epam/assets": "5.9.5",
"@epam/uui": "5.9.5",
"@epam/uui-components": "5.9.5",
"@epam/uui-core": "5.9.5",
"@types/classnames": "2.2.6",
"classnames": "2.2.6"
},
Expand Down
8 changes: 4 additions & 4 deletions extra/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/uui-extra",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM UUI components set branded with 'loveship' style",
"author": "EPAM",
"license": "MIT",
Expand All @@ -11,9 +11,9 @@
"build": "ts-node ../uui-build/ts/scripts/buildUuiModule.ts"
},
"dependencies": {
"@epam/loveship": "5.9.2",
"@epam/promo": "5.9.2",
"@epam/uui-core": "5.9.2",
"@epam/loveship": "5.9.5",
"@epam/promo": "5.9.5",
"@epam/uui-core": "5.9.5",
"immutable": "3.8.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.9.2",
"version": "5.9.5",
"npmClient": "yarn",
"useWorkspaces": true,
"exact": true
Expand Down
10 changes: 5 additions & 5 deletions loveship/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/loveship",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM UUI components set branded with 'loveship' style",
"author": "EPAM",
"license": "MIT",
Expand All @@ -12,10 +12,10 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/assets": "5.9.2",
"@epam/uui": "5.9.2",
"@epam/uui-components": "5.9.2",
"@epam/uui-core": "5.9.2",
"@epam/assets": "5.9.5",
"@epam/uui": "5.9.5",
"@epam/uui-components": "5.9.5",
"@epam/uui-core": "5.9.5",
"@types/classnames": "2.2.6",
"classnames": "2.2.6"
},
Expand Down
2 changes: 1 addition & 1 deletion templates/uui-cra-template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/cra-template-uui",
"version": "5.9.2",
"version": "5.9.5",
"keywords": [
"UUI",
"react",
Expand Down
4 changes: 2 additions & 2 deletions test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/uui-test-utils",
"version": "5.9.2",
"version": "5.9.5",
"author": "EPAM",
"license": "MIT",
"private": false,
Expand All @@ -11,7 +11,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/uui-core": "5.9.2",
"@epam/uui-core": "5.9.5",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@types/react-test-renderer": "18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion uui-build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/uui-build",
"version": "5.9.2",
"version": "5.9.5",
"bin": {
"epam-uui-build": "./bin/cli.js"
},
Expand Down
4 changes: 2 additions & 2 deletions uui-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/uui-components",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM UUI Components",
"author": "EPAM",
"license": "MIT",
Expand All @@ -13,7 +13,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/uui-core": "5.9.2",
"@epam/uui-core": "5.9.5",
"@popperjs/core": "2.9.0",
"@types/classnames": "2.2.6",
"@types/react-measure": "2.0.8",
Expand Down
2 changes: 1 addition & 1 deletion uui-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/uui-core",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM UUI Core",
"author": "EPAM",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion uui-core/src/data/processing/ArrayDataSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ArrayDataSource<TItem = any, TId = any, TFilter = any> extends Base
super(props);
this.setProps(props);
const params = { getId: this.getId, complexIds: props.complexIds };
this.itemsStorage = new ItemsStorage({ items: [], params: params });
this.itemsStorage = new ItemsStorage({ items: props.items, params: params });
}

public setProps(props: ArrayDataSourceProps<TItem, TId, TFilter>) {
Expand Down
4 changes: 2 additions & 2 deletions uui-core/src/data/processing/views/tree/ItemsStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ItemsStorage<TItem, TId> {
return this._itemsMap;
};

public getItemsMap() {
public getItemsMap = () => {
return this._itemsMap;
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { usePrevious } from '../../../../../../../hooks/usePrevious';
import {
useItemsStorage, useDataSourceStateWithDefaults, useFilterTree, useSortTree,
useSearchTree, useSelectedOnlyTree, usePatchTree,
useActualItemsMap,
} from '../../common';
import { UseTreeResult } from '../../types';

Expand Down Expand Up @@ -54,9 +55,12 @@ export function useAsyncTree<TItem, TId, TFilter = any>(

const [incommingTree, setIncommingTree] = useState(baseTree);

useEffect(() => {
setIncommingTree(TreeState.blank({ getId, getParentId, complexIds }, itemsMap, setItems));
}, [...deps]);

const prevIsForceReload = usePrevious(isForceReload);
const dataSourceState = useDataSourceStateWithDefaults({ dataSourceState: props.dataSourceState });

const { tree: treeWithData, itemsStatusCollector, isLoaded: isTreeLoaded, isLoading, isFetching } = useLoadData({
getId,
complexIds,
Expand Down Expand Up @@ -118,8 +122,13 @@ export function useAsyncTree<TItem, TId, TFilter = any>(
isLoading: isTreeLoading,
}, [searchTree, isTreeLoading]);

const { tree, applyPatch } = usePatchTree({
const treeWithNewItemsMap = useActualItemsMap({
tree: treeWithSelectedOnly,
itemsMap,
});

const { tree, applyPatch } = usePatchTree({
tree: treeWithNewItemsMap,
patch: showSelectedOnly ? null : patch,
isDeleted,
getNewItemPosition,
Expand All @@ -137,7 +146,7 @@ export function useAsyncTree<TItem, TId, TFilter = any>(

return {
tree: showSelectedOnly ? tree.selectedOnly : tree.visible,
treeWithoutPatch: treeWithSelectedOnly.visible,
treeWithoutPatch: treeWithNewItemsMap.visible,
selectionTree: tree.full,
reload,
totalCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { TreeState } from '../../../treeState';
import { usePrevious } from '../../../../../../../hooks/usePrevious';
import { isQueryChanged } from '../lazyTree/helpers';
import { useItemsStatusCollector } from '../../common';
import { useDepsChanged } from '../../common/useDepsChanged';
import { getSelectedAndChecked } from '../../../treeStructure';
import { NOT_FOUND_RECORD } from '../../../constants';
import { ItemsStatuses } from '../types';
Expand Down Expand Up @@ -95,8 +94,6 @@ export function useLoadData<TItem, TId, TFilter = any>(
}
}, [api]);

const depsChanged = useDepsChanged(deps);

const shouldForceReload = prevForceReload !== forceReload && forceReload;

const shouldLoad = (
Expand All @@ -111,6 +108,12 @@ export function useLoadData<TItem, TId, TFilter = any>(
}
}, [shouldForceReload]);

useEffect(() => {
if (isLoaded) {
setIsLoaded(false);
}
}, [...deps]);

useEffect(() => {
if (shouldLoad) {
setIsFetching(true);
Expand Down Expand Up @@ -140,7 +143,7 @@ export function useLoadData<TItem, TId, TFilter = any>(
setIsLoading(false);
});
}
}, [shouldLoad, depsChanged, shouldForceReload]);
}, [...deps, shouldLoad, shouldForceReload]);

return { tree: loadedTree, isLoading, isFetching, isLoaded, itemsStatusCollector };
}
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class TreeState<TItem, TId> {
) {
const itemsAccessor = ItemsAccessor.toItemsAccessor(itemsMap);
const treeStructure = TreeStructure.createFromItems({ params, items: itemsMap, itemsAccessor });
return new TreeState(
return this.create(
treeStructure,
treeStructure,
TreeStructure.create(params, ItemsAccessor.toItemsAccessor(itemsMap)),
Expand Down
4 changes: 2 additions & 2 deletions uui-db/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/uui-db",
"version": "5.9.2",
"version": "5.9.5",
"description": "UUI - client-side relational state cache",
"author": "EPAM",
"license": "MIT",
Expand All @@ -14,7 +14,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/uui-core": "5.9.2",
"@epam/uui-core": "5.9.5",
"@types/lodash.countby": "4.6.6",
"@types/lodash.filter": "4.6.6",
"@types/lodash.foreach": "4.5.6",
Expand Down
12 changes: 6 additions & 6 deletions uui-docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epam/uui-docs",
"version": "5.9.2",
"version": "5.9.5",
"description": "EPAM UUI Documentation infrastructure",
"author": "EPAM",
"license": "MIT",
Expand All @@ -12,11 +12,11 @@
"prepublish": "yarn build"
},
"dependencies": {
"@epam/assets": "5.9.2",
"@epam/promo": "5.9.2",
"@epam/uui": "5.9.2",
"@epam/uui-components": "5.9.2",
"@epam/uui-core": "5.9.2",
"@epam/assets": "5.9.5",
"@epam/promo": "5.9.5",
"@epam/uui": "5.9.5",
"@epam/uui-components": "5.9.5",
"@epam/uui-core": "5.9.5",
"@types/classnames": "2.2.6",
"classnames": "^2.2.6"
},
Expand Down
Loading

0 comments on commit b4a7d28

Please sign in to comment.