Rename calculateNewExpandedState -> updateItemInExpandedState
This commit is contained in:
Родитель
1a08ae4df2
Коммит
f3d0773085
|
@ -31,7 +31,7 @@ export interface RemoteUserDefinedListExpandedDbItem {
|
|||
listName: string;
|
||||
}
|
||||
|
||||
export function calculateNewExpandedState(
|
||||
export function updateItemInExpandedState(
|
||||
currentExpandedItems: ExpandedDbItem[],
|
||||
dbItem: DbItem,
|
||||
itemExpanded: boolean,
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AppEvent, AppEventEmitter } from "../common/events";
|
|||
import { ValueResult } from "../common/value-result";
|
||||
import { DbConfigStore } from "./config/db-config-store";
|
||||
import { DbItem, DbListKind } from "./db-item";
|
||||
import { calculateNewExpandedState, ExpandedDbItem } from "./db-item-expansion";
|
||||
import { updateItemInExpandedState, ExpandedDbItem } from "./db-item-expansion";
|
||||
import {
|
||||
getSelectedDbItem,
|
||||
mapDbItemToSelectedDbItem,
|
||||
|
@ -74,7 +74,7 @@ export class DbManager {
|
|||
|
||||
const currentExpandedItems = this.getCurrentExpandedItems();
|
||||
|
||||
const newExpandedItems = calculateNewExpandedState(
|
||||
const newExpandedItems = updateItemInExpandedState(
|
||||
currentExpandedItems,
|
||||
dbItem,
|
||||
itemExpanded,
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
RootRemoteDbItem,
|
||||
} from "../../../src/databases/db-item";
|
||||
import {
|
||||
calculateNewExpandedState,
|
||||
updateItemInExpandedState,
|
||||
ExpandedDbItem,
|
||||
ExpandedDbItemKind,
|
||||
} from "../../../src/databases/db-item-expansion";
|
||||
|
@ -29,7 +29,7 @@ describe("db item expansion", () => {
|
|||
listName: "list2",
|
||||
});
|
||||
|
||||
const newExpandedItems = calculateNewExpandedState(
|
||||
const newExpandedItems = updateItemInExpandedState(
|
||||
currentExpandedItems,
|
||||
dbItem,
|
||||
true,
|
||||
|
@ -50,7 +50,7 @@ describe("db item expansion", () => {
|
|||
listName: "list2",
|
||||
});
|
||||
|
||||
const newExpandedItems = calculateNewExpandedState([], dbItem, true);
|
||||
const newExpandedItems = updateItemInExpandedState([], dbItem, true);
|
||||
|
||||
expect(newExpandedItems).toEqual([
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ describe("db item expansion", () => {
|
|||
listName: "list1",
|
||||
});
|
||||
|
||||
const newExpandedItems = calculateNewExpandedState(
|
||||
const newExpandedItems = updateItemInExpandedState(
|
||||
currentExpandedItems,
|
||||
dbItem,
|
||||
false,
|
||||
|
@ -98,7 +98,7 @@ describe("db item expansion", () => {
|
|||
|
||||
const dbItem: RootRemoteDbItem = createRootRemoteDbItem();
|
||||
|
||||
const newExpandedItems = calculateNewExpandedState(
|
||||
const newExpandedItems = updateItemInExpandedState(
|
||||
currentExpandedItems,
|
||||
dbItem,
|
||||
false,
|
||||
|
|
Загрузка…
Ссылка в новой задаче