Skip to content

Commit

Permalink
Merge branch 'main' into CHARTS-10604
Browse files Browse the repository at this point in the history
  • Loading branch information
DaryaLari authored Dec 2, 2024
2 parents f93805a + 4ce8e03 commit fe5bc32
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 36 deletions.
10 changes: 0 additions & 10 deletions src/server/components/features/features-list/UseNavigation.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/shared/types/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export enum Feature {
EnableAutocreateDataset = 'EnableAutocreateDataset',
ShowCreateEntryWithMenu = 'ShowCreateEntryWithMenu',
RevisionsListNoLimit = 'RevisionsListNoLimit',
UseNavigation = 'UseNavigation',
AuthUpdateWithTimeout = 'AuthUpdateWithTimeout',
UseComponentHeader = 'UseComponentHeader',
FetchDocumentation = 'FetchDocumentation',
Expand Down
10 changes: 2 additions & 8 deletions src/ui/components/DashKit/helpers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {DL} from 'constants/common';

import React from 'react';

import type {ConfigItem, DashKitProps, ItemState} from '@gravity-ui/dashkit';
Expand All @@ -10,9 +8,8 @@ import {Icon} from '@gravity-ui/uikit';
import block from 'bem-cn-lite';
import {I18n} from 'i18n';
import type {DashChartRequestContext, StringParams} from 'shared';
import {DashTabItemControlSourceType, DashTabItemType, Feature} from 'shared';
import {DashTabItemControlSourceType, DashTabItemType} from 'shared';
import {DashKitOverlayMenuQa} from 'shared/constants/qa/dash';
import {Utils} from 'ui';
import {ExtendedDashKitContext} from 'ui/units/dash/utils/context';

import {getEndpointForNavigation} from '../../libs/DatalensChartkit/modules/navigation';
Expand Down Expand Up @@ -58,10 +55,7 @@ export function getEditLink(configItem: ConfigItem, params: StringParams, state:
}

// does not work properly in DEV mode without navigator
const endpoint = getEndpointForNavigation(
DL.ENDPOINTS,
Utils.isEnabledFeature(Feature.UseNavigation),
);
const endpoint = getEndpointForNavigation();

const linkParams = removeEmptyParams(params);

Expand Down
7 changes: 2 additions & 5 deletions src/ui/libs/DatalensChartkit/Error/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {I18n, i18n} from 'i18n';
import isEmpty from 'lodash/isEmpty';
import uniqBy from 'lodash/uniqBy';
import {useDispatch} from 'react-redux';
import {ChartkitMenuDialogsQA, ErrorCode, Feature} from 'shared';
import {ChartkitMenuDialogsQA, ErrorCode} from 'shared';
import {isEmbeddedEntry} from 'ui/utils/embedded';

import {DL, Interpolate, Utils} from '../../..';
Expand Down Expand Up @@ -169,10 +169,7 @@ const ChartKitError: React.FC<any> = (props) => {
iconData = Lock;
const entryId = error?.debug?.entryId;
if (entryId) {
const endpoint = getEndpointForNavigation(
DL.ENDPOINTS,
Utils.isEnabledFeature(Feature.UseNavigation),
);
const endpoint = getEndpointForNavigation();
const text = i18n('component.chartkit-error.codes', code);
const href = `${endpoint}/${entryId}`;

Expand Down
4 changes: 1 addition & 3 deletions src/ui/libs/DatalensChartkit/menu/MenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ export const getEditMenuItem = ({
(dataProvider || chartsDataProvider)?.getGoAwayLink(
{loadedData, propsData},
{
idPrefix: Utils.isEnabledFeature(Feature.UseNavigation)
? '/navigation/'
: '/navigate/',
idPrefix: '/navigate/',
},
),
);
Expand Down
7 changes: 2 additions & 5 deletions src/ui/libs/DatalensChartkit/modules/navigation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export function getEndpointForNavigation(
endpoints: Record<string, string>,
useNavigation = false,
): string {
return useNavigation ? `${endpoints.charts}/navigation` : '/navigate';
export function getEndpointForNavigation(): string {
return '/navigate';
}
6 changes: 2 additions & 4 deletions src/ui/units/dash/modules/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type {
StringParams,
WorkbookId,
} from 'shared';
import {DashTabItemType, Feature, resolveOperation} from 'shared';
import {DashTabItemType, resolveOperation} from 'shared';
import {COPIED_WIDGET_STORAGE_KEY, DL, Utils} from 'ui';
import {registry} from 'ui/registry';
import {collectWidgetItemIds} from 'ui/utils/copyItems';
Expand Down Expand Up @@ -175,9 +175,7 @@ export function addOperationForValue(args: {
}

export function getChartEditLink(entryId: string) {
return Utils.isEnabledFeature(Feature.UseNavigation)
? `${window.DL.endpoints.charts}/navigation/${entryId}`
: `/navigate/${entryId}`;
return `/navigate/${entryId}`;
}

export function deepAssign(...args: any) {
Expand Down

0 comments on commit fe5bc32

Please sign in to comment.