Rename calculateNewExpandedState -> updateItemInExpandedState
This commit is contained in:
@@ -31,7 +31,7 @@ export interface RemoteUserDefinedListExpandedDbItem {
|
|||||||
listName: string;
|
listName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculateNewExpandedState(
|
export function updateItemInExpandedState(
|
||||||
currentExpandedItems: ExpandedDbItem[],
|
currentExpandedItems: ExpandedDbItem[],
|
||||||
dbItem: DbItem,
|
dbItem: DbItem,
|
||||||
itemExpanded: boolean,
|
itemExpanded: boolean,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { AppEvent, AppEventEmitter } from "../common/events";
|
|||||||
import { ValueResult } from "../common/value-result";
|
import { ValueResult } from "../common/value-result";
|
||||||
import { DbConfigStore } from "./config/db-config-store";
|
import { DbConfigStore } from "./config/db-config-store";
|
||||||
import { DbItem, DbListKind } from "./db-item";
|
import { DbItem, DbListKind } from "./db-item";
|
||||||
import { calculateNewExpandedState, ExpandedDbItem } from "./db-item-expansion";
|
import { updateItemInExpandedState, ExpandedDbItem } from "./db-item-expansion";
|
||||||
import {
|
import {
|
||||||
getSelectedDbItem,
|
getSelectedDbItem,
|
||||||
mapDbItemToSelectedDbItem,
|
mapDbItemToSelectedDbItem,
|
||||||
@@ -74,7 +74,7 @@ export class DbManager {
|
|||||||
|
|
||||||
const currentExpandedItems = this.getCurrentExpandedItems();
|
const currentExpandedItems = this.getCurrentExpandedItems();
|
||||||
|
|
||||||
const newExpandedItems = calculateNewExpandedState(
|
const newExpandedItems = updateItemInExpandedState(
|
||||||
currentExpandedItems,
|
currentExpandedItems,
|
||||||
dbItem,
|
dbItem,
|
||||||
itemExpanded,
|
itemExpanded,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
RootRemoteDbItem,
|
RootRemoteDbItem,
|
||||||
} from "../../../src/databases/db-item";
|
} from "../../../src/databases/db-item";
|
||||||
import {
|
import {
|
||||||
calculateNewExpandedState,
|
updateItemInExpandedState,
|
||||||
ExpandedDbItem,
|
ExpandedDbItem,
|
||||||
ExpandedDbItemKind,
|
ExpandedDbItemKind,
|
||||||
} from "../../../src/databases/db-item-expansion";
|
} from "../../../src/databases/db-item-expansion";
|
||||||
@@ -29,7 +29,7 @@ describe("db item expansion", () => {
|
|||||||
listName: "list2",
|
listName: "list2",
|
||||||
});
|
});
|
||||||
|
|
||||||
const newExpandedItems = calculateNewExpandedState(
|
const newExpandedItems = updateItemInExpandedState(
|
||||||
currentExpandedItems,
|
currentExpandedItems,
|
||||||
dbItem,
|
dbItem,
|
||||||
true,
|
true,
|
||||||
@@ -50,7 +50,7 @@ describe("db item expansion", () => {
|
|||||||
listName: "list2",
|
listName: "list2",
|
||||||
});
|
});
|
||||||
|
|
||||||
const newExpandedItems = calculateNewExpandedState([], dbItem, true);
|
const newExpandedItems = updateItemInExpandedState([], dbItem, true);
|
||||||
|
|
||||||
expect(newExpandedItems).toEqual([
|
expect(newExpandedItems).toEqual([
|
||||||
{
|
{
|
||||||
@@ -76,7 +76,7 @@ describe("db item expansion", () => {
|
|||||||
listName: "list1",
|
listName: "list1",
|
||||||
});
|
});
|
||||||
|
|
||||||
const newExpandedItems = calculateNewExpandedState(
|
const newExpandedItems = updateItemInExpandedState(
|
||||||
currentExpandedItems,
|
currentExpandedItems,
|
||||||
dbItem,
|
dbItem,
|
||||||
false,
|
false,
|
||||||
@@ -98,7 +98,7 @@ describe("db item expansion", () => {
|
|||||||
|
|
||||||
const dbItem: RootRemoteDbItem = createRootRemoteDbItem();
|
const dbItem: RootRemoteDbItem = createRootRemoteDbItem();
|
||||||
|
|
||||||
const newExpandedItems = calculateNewExpandedState(
|
const newExpandedItems = updateItemInExpandedState(
|
||||||
currentExpandedItems,
|
currentExpandedItems,
|
||||||
dbItem,
|
dbItem,
|
||||||
false,
|
false,
|
||||||
|
|||||||
Reference in New Issue
Block a user