diff --git a/packages/containers/CHANGELOG.md b/packages/containers/CHANGELOG.md index b5898e7811f..70a34e64653 100644 --- a/packages/containers/CHANGELOG.md +++ b/packages/containers/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/react-containers +## 11.2.0 + +### Minor Changes + +- da838fe: fix(TMC-29799): highlighting selected item in side panel and opening link in new tab + ## 11.1.0 ### Minor Changes diff --git a/packages/containers/package.json b/packages/containers/package.json index f53de7221b0..89bee0a69ce 100644 --- a/packages/containers/package.json +++ b/packages/containers/package.json @@ -67,7 +67,7 @@ "@talend/locales-tui-forms": "^10.2.4", "@talend/locales-design-system": "^7.15.1", "@talend/react-storybook-cmf": "^10.0.0", - "@talend/eslint-config": "^13.2.0", + "@talend/eslint-config": "^13.2.1", "@talend/eslint-plugin": "^1.3.1", "@talend/scripts-core": "^16.5.1", "@talend/scripts-config-babel": "^13.5.0", @@ -95,5 +95,5 @@ "publishConfig": { "access": "public" }, - "version": "11.1.0" + "version": "11.2.0" } diff --git a/packages/containers/src/SidePanel/SidePanel.connect.js b/packages/containers/src/SidePanel/SidePanel.connect.js index ad4c5e1e8b6..fb668ba290a 100644 --- a/packages/containers/src/SidePanel/SidePanel.connect.js +++ b/packages/containers/src/SidePanel/SidePanel.connect.js @@ -1,7 +1,9 @@ import get from 'lodash/get'; + import cmf, { cmfConnect } from '@talend/react-cmf'; -import Container, { DEFAULT_STATE } from './SidePanel.container'; + import { ACTION_TYPE_LINK } from './constants'; +import Container, { DEFAULT_STATE } from './SidePanel.container'; const cache = {}; @@ -73,7 +75,13 @@ function getActionsWrapped(actions) { } function getSelectedAction(currentRoute, actions) { - const getFullPath = href => `${window.basename || ''}${href}`.replaceAll('//', '/'); + const getFullPath = href => { + if (!window.basename || window.basename === '/' || href.startsWith(window.basename)) { + return href; + } + + return `${window.basename || ''}${href}`.replaceAll('//', '/'); + }; return actions.find( action => action.href && isBasePathOf(getFullPath(action.href), currentRoute), ); @@ -123,9 +131,18 @@ function getAction(id, currentRoute, state) { */ function getActions(state, ownProps, currentRoute) { if (ownProps.actions) { - const cacheAction = getCache(ownProps.componentId, currentRoute, ownProps.actions); + let actions = ownProps.actions; + + if (window.basename && window.basename !== '/') { + actions = ownProps.actions.map(action => ({ + ...action, + href: `${window.basename}${action.href}`.replaceAll('//', '/'), + })); + } + + const cacheAction = getCache(ownProps.componentId, currentRoute, actions); if (!cacheAction.value) { - cacheAction.value = getActionsWrapped(ownProps.actions); + cacheAction.value = getActionsWrapped(actions); } return cacheAction.value; } else if (ownProps.actionIds) { diff --git a/tools/scripts-config-eslint/.eslintrc.json b/tools/scripts-config-eslint/.eslintrc.json index 4a92186602a..cb6e81924aa 100644 --- a/tools/scripts-config-eslint/.eslintrc.json +++ b/tools/scripts-config-eslint/.eslintrc.json @@ -122,5 +122,5 @@ } }, // Ignore some JS at project's rool level - "ignorePatterns": ["index.js", ".eslintrc.js"] + "ignorePatterns": ["./index.js", "./.eslintrc.js"] } diff --git a/tools/scripts-config-eslint/CHANGELOG.md b/tools/scripts-config-eslint/CHANGELOG.md index c111ec020a9..0ad0a27ada9 100644 --- a/tools/scripts-config-eslint/CHANGELOG.md +++ b/tools/scripts-config-eslint/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/scripts-config-eslint +## 13.2.1 + +### Patch Changes + +- 5f0acd2: fix: ignorePattern only at root level for index.js + ## 13.2.0 ### Minor Changes diff --git a/tools/scripts-config-eslint/package.json b/tools/scripts-config-eslint/package.json index 45171de386e..dcf5eb78777 100644 --- a/tools/scripts-config-eslint/package.json +++ b/tools/scripts-config-eslint/package.json @@ -1,7 +1,7 @@ { "name": "@talend/eslint-config", "description": "Eslint configuration for @talend/scripts-core", - "version": "13.2.0", + "version": "13.2.1", "license": "Apache-2.0", "main": "index.js", "author": "Talend Frontend ",