mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Start using named export for composite
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
parent
e7b652c627
commit
5b916be7c0
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import type { Composite } from "../get-composite/get-composite";
|
import type { Composite } from "../get-composite/get-composite";
|
||||||
import { compositeHasDescendant } from "./composite-has-descendant";
|
import { compositeHasDescendant } from "./composite-has-descendant";
|
||||||
import getCompositeFor from "../get-composite/get-composite";
|
import { getCompositeFor } from "../get-composite/get-composite";
|
||||||
|
|
||||||
describe("composite-has-descendant, given composite with children and grand children", () => {
|
describe("composite-has-descendant, given composite with children and grand children", () => {
|
||||||
let composite: Composite<{ id: string; parentId?: string }>;
|
let composite: Composite<{ id: string; parentId?: string }>;
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
import type { Composite } from "../get-composite/get-composite";
|
import type { Composite } from "../get-composite/get-composite";
|
||||||
import { findComposite } from "./find-composite";
|
import { findComposite } from "./find-composite";
|
||||||
import getCompositeFor from "../get-composite/get-composite";
|
import { getCompositeFor } from "../get-composite/get-composite";
|
||||||
|
|
||||||
describe("find-composite", () => {
|
describe("find-composite", () => {
|
||||||
let composite: Composite<{ id: string; parentId?: string }>;
|
let composite: Composite<{ id: string; parentId?: string }>;
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getCompositeNormalization } from "./get-composite-normalization";
|
import { getCompositeNormalization } from "./get-composite-normalization";
|
||||||
import getCompositeFor from "../get-composite/get-composite";
|
import { getCompositeFor } from "../get-composite/get-composite";
|
||||||
|
|
||||||
|
|
||||||
describe("get-composite-normalization", () => {
|
describe("get-composite-normalization", () => {
|
||||||
it("given a composite, flattens it to paths and composites", () => {
|
it("given a composite, flattens it to paths and composites", () => {
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getCompositePaths } from "./get-composite-paths";
|
import { getCompositePaths } from "./get-composite-paths";
|
||||||
import getCompositeFor from "../get-composite/get-composite";
|
|
||||||
import { sortBy } from "lodash/fp";
|
import { sortBy } from "lodash/fp";
|
||||||
|
import { getCompositeFor } from "../get-composite/get-composite";
|
||||||
|
|
||||||
describe("get-composite-paths", () => {
|
describe("get-composite-paths", () => {
|
||||||
it("given composite with transformed children, returns paths of transformed children in hierarchical order", () => {
|
it("given composite with transformed children, returns paths of transformed children in hierarchical order", () => {
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Composite } from "./get-composite";
|
import type { Composite } from "./get-composite";
|
||||||
import getCompositeFor from "./get-composite";
|
|
||||||
import { getCompositePaths } from "../get-composite-paths/get-composite-paths";
|
import { getCompositePaths } from "../get-composite-paths/get-composite-paths";
|
||||||
import { sortBy } from "lodash/fp";
|
import { sortBy } from "lodash/fp";
|
||||||
|
import { getCompositeFor } from "./get-composite";
|
||||||
|
|
||||||
interface SomeItem {
|
interface SomeItem {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@ -31,7 +31,7 @@ interface Configuration<T> {
|
|||||||
handleMissingParentIds?: (parentIdsForHandling: ParentIdsForHandling) => void;
|
handleMissingParentIds?: (parentIdsForHandling: ParentIdsForHandling) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default <T>({
|
export const getCompositeFor = <T>({
|
||||||
rootId = undefined,
|
rootId = undefined,
|
||||||
getId,
|
getId,
|
||||||
getParentId,
|
getParentId,
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import applicationMenuItemsInjectable from "./application-menu-items.injectable";
|
import applicationMenuItemsInjectable from "./application-menu-items.injectable";
|
||||||
import type { Composite } from "../../../common/utils/composite/get-composite/get-composite";
|
import type { Composite } from "../../../common/utils/composite/get-composite/get-composite";
|
||||||
import getCompositeFor from "../../../common/utils/composite/get-composite/get-composite";
|
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import { pipeline } from "@ogre-tools/fp";
|
import { pipeline } from "@ogre-tools/fp";
|
||||||
import type { ApplicationMenuItemTypes } from "./menu-items/application-menu-item-injection-token";
|
import type { ApplicationMenuItemTypes } from "./menu-items/application-menu-item-injection-token";
|
||||||
@ -15,6 +14,7 @@ import type { Orderable } from "../../../common/utils/composable-responsibilitie
|
|||||||
import { orderByOrderNumber } from "../../../common/utils/composable-responsibilities/orderable/orderable";
|
import { orderByOrderNumber } from "../../../common/utils/composable-responsibilities/orderable/orderable";
|
||||||
import logErrorInjectable from "../../../common/log-error.injectable";
|
import logErrorInjectable from "../../../common/log-error.injectable";
|
||||||
import { isShown } from "../../../common/utils/composable-responsibilities/showable/showable";
|
import { isShown } from "../../../common/utils/composable-responsibilities/showable/showable";
|
||||||
|
import { getCompositeFor } from "../../../common/utils/composite/get-composite/get-composite";
|
||||||
|
|
||||||
export type MenuItemRoot = Discriminable<"root"> &
|
export type MenuItemRoot = Discriminable<"root"> &
|
||||||
RootComposite<"root"> &
|
RootComposite<"root"> &
|
||||||
|
|||||||
@ -12,8 +12,8 @@ import type { PreferenceTabsRoot } from "./preference-tab-root";
|
|||||||
import { preferenceTabsRoot } from "./preference-tab-root";
|
import { preferenceTabsRoot } from "./preference-tab-root";
|
||||||
import logErrorInjectable from "../../../../common/log-error.injectable";
|
import logErrorInjectable from "../../../../common/log-error.injectable";
|
||||||
import { isShown } from "../../../../common/utils/composable-responsibilities/showable/showable";
|
import { isShown } from "../../../../common/utils/composable-responsibilities/showable/showable";
|
||||||
import getCompositeFor from "../../../../common/utils/composite/get-composite/get-composite";
|
|
||||||
import { orderByOrderNumber } from "../../../../common/utils/composable-responsibilities/orderable/orderable";
|
import { orderByOrderNumber } from "../../../../common/utils/composable-responsibilities/orderable/orderable";
|
||||||
|
import { getCompositeFor } from "../../../../common/utils/composite/get-composite/get-composite";
|
||||||
|
|
||||||
const preferencesCompositeInjectable = getInjectable({
|
const preferencesCompositeInjectable = getInjectable({
|
||||||
id: "preferences-composite",
|
id: "preferences-composite",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user