Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ module.exports = {
},
overrides: [
{
files: ["./**/*.tsx"],
excludedFiles: ["./src/common/icons/**/*Icon.tsx"],
files: ["./src/components/common/icons/**/*Icon.tsx"],
rules: {
"react/jsx-curly-brace-presence": "off"
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/Assets/AssetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ export const AssetList = ({
sortOrder: sorting.order,
scopedSpanCodeObjectId: scopeSpanCodeObjectId,
...(search.length > 0 ? { displayName: search } : {}),
...(scopeSpanCodeObjectId ? { ...filters, services: [] } : filters),
insights: filters?.insights ?? [],
operations: [
...(filters?.endpoints ?? []),
...(filters?.consumers ?? []),
...(filters?.internals ?? [])
],
services: scopeSpanCodeObjectId ? [] : filters?.services ?? [],
directOnly: viewMode === "children"
}
}),
Expand Down
24 changes: 14 additions & 10 deletions src/components/Assets/AssetTypeList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
import { DigmaMessageError } from "../../../api/types";
import { dispatcher } from "../../../dispatcher";
import { usePrevious } from "../../../hooks/usePrevious";
import { AssetsFilters } from "../../../store/assets/assetsSlice";
import { useAssetsSelector } from "../../../store/assets/useAssetsSelector";
import { useConfigSelector } from "../../../store/config/useConfigSelector";
import { useStore } from "../../../store/useStore";
Expand All @@ -12,7 +13,6 @@ import { SCOPE_CHANGE_EVENTS } from "../../../types";
import { changeScope } from "../../../utils/actions/changeScope";
import { sendUserActionTrackingEvent } from "../../../utils/actions/sendUserActionTrackingEvent";
import { ChildIcon } from "../../common/icons/30px/ChildIcon";
import { AssetFilterQuery } from "../AssetsFilter/types";
import { ViewMode } from "../AssetsViewScopeConfiguration/types";
import { NoDataMessage } from "../NoDataMessage";
import { actions } from "../actions";
Expand All @@ -23,7 +23,8 @@ import * as s from "./styles";
import {
AssetCategoriesData,
AssetCategoryData,
AssetTypeListProps
AssetTypeListProps,
GetAssetCategoriesDataPayload
} from "./types";

const REFRESH_INTERVAL = 10 * 1000; // in milliseconds
Expand All @@ -40,23 +41,26 @@ export const ASSET_TYPE_IDS = [
];

const getData = (
filters: AssetFilterQuery,
filters: AssetsFilters | null,
searchQuery: string,
viewMode: ViewMode,
scopeSpanCodeObjectId?: string
) => {
window.sendMessageToDigma({
window.sendMessageToDigma<GetAssetCategoriesDataPayload>({
action: actions.GET_CATEGORIES_DATA,
payload: {
query: {
directOnly: viewMode === "children",
scopedSpanCodeObjectId: scopeSpanCodeObjectId,
...(scopeSpanCodeObjectId
? {
...filters,
services: []
}
: filters),
...{
insights: filters?.insights ?? [],
operations: [
...(filters?.endpoints ?? []),
...(filters?.consumers ?? []),
...(filters?.internals ?? [])
],
services: scopeSpanCodeObjectId ? [] : filters?.services ?? []
},
...(searchQuery.length > 0 ? { displayName: searchQuery } : {})
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/components/Assets/AssetTypeList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ export interface AssetCategoryData {
label?: string;
icon?: MemoExoticComponent<(props: IconProps) => JSX.Element>;
}

export interface GetAssetCategoriesDataPayload {
query: {
directOnly: boolean;
scopedSpanCodeObjectId?: string;
services: string[];
operations: string[];
insights: string[];
displayName?: string;
};
}
Loading
Loading