Skip to content

Commit

Permalink
Move to navigate route by default (#1829)
Browse files Browse the repository at this point in the history
Co-authored-by: Evgenij Shangin <[email protected]>
  • Loading branch information
goshander and jhoncool authored Nov 22, 2024
1 parent c728cf7 commit 605cb2f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/server/components/resolve-entry-by-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async function resolveEntryByLink({
const idOrKeyOrReport =
url.pathname
.replace(/^\/navigation\//, '')
.replace(/^\/navigate\//, '')
.replace(/^\/wizard\/preview\//, '')
.replace(
/^(\/(ChartPreview|preview))?(\/(ChartWizard|wizard|ChartEditor|editor))?\/?/,
Expand Down
6 changes: 5 additions & 1 deletion src/ui/libs/DatalensChartkit/menu/MenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ export const getEditMenuItem = ({
window.open(
(dataProvider || chartsDataProvider)?.getGoAwayLink(
{loadedData, propsData},
{idPrefix: '/navigation/'},
{
idPrefix: Utils.isEnabledFeature(Feature.UseNavigation)
? '/navigation/'
: '/navigate/',
},
),
);
}),
Expand Down
3 changes: 0 additions & 3 deletions src/ui/libs/DatalensChartkit/modules/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ export const getChartkitMenuByType = (props?: GetChartkitMenuByType) => {
},
[MenuItemsIds.EDIT]: {
title: i18n('dash.chartkit-menu.view', 'button_edit'),
action: ({propsData: {id, params}}) => {
window.open(`/navigate/${id}?${stringify(params)}`);
},
...isEditVisible,
},
[MenuItemsIds.EXPORT]: {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/units/dash/modules/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function addOperationForValue(args: {
export function getChartEditLink(entryId: string) {
return Utils.isEnabledFeature(Feature.UseNavigation)
? `${window.DL.endpoints.charts}/navigation/${entryId}`
: `${window.DL.endpoints.wizard}/${entryId}`;
: `/navigate/${entryId}`;
}

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

0 comments on commit 605cb2f

Please sign in to comment.