Skip to content

Commit

Permalink
Merge branch 'master' into jmfrancois/chore/update-postcss
Browse files Browse the repository at this point in the history
  • Loading branch information
yyanwang authored Sep 9, 2024
2 parents 628d035 + ec618b5 commit 7f85b0a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
6 changes: 6 additions & 0 deletions packages/containers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/containers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -95,5 +95,5 @@
"publishConfig": {
"access": "public"
},
"version": "11.1.0"
"version": "11.2.0"
}
25 changes: 21 additions & 4 deletions packages/containers/src/SidePanel/SidePanel.connect.js
Original file line number Diff line number Diff line change
@@ -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 = {};

Expand Down Expand Up @@ -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),
);
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-eslint/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@
}
},
// Ignore some JS at project's rool level
"ignorePatterns": ["index.js", ".eslintrc.js"]
"ignorePatterns": ["./index.js", "./.eslintrc.js"]
}
6 changes: 6 additions & 0 deletions tools/scripts-config-eslint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts-config-eslint/package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down

0 comments on commit 7f85b0a

Please sign in to comment.