Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
zovomat committed May 2, 2022
2 parents 98467a3 + c7ccd56 commit 4e5a05a
Show file tree
Hide file tree
Showing 17 changed files with 111 additions and 1,090 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.4.14](https://github.com/zextras/carbonio-shell-ui/compare/v0.4.13...v0.4.14) (2022-05-02)


### Bug Fixes

* routing inside search module ([b66206e](https://github.com/zextras/carbonio-shell-ui/commit/b66206e5039801e7be4d1533ea9ce1671012b75d))

### [0.4.13](https://github.com/zextras/carbonio-shell-ui/compare/v0.4.12...v0.4.13) (2022-04-27)

### [0.4.12](https://github.com/zextras/carbonio-shell-ui/compare/v0.4.11...v0.4.12) (2022-04-26)

### [0.4.11](https://github.com/zextras/carbonio-shell-ui/compare/v0.4.10...v0.4.11) (2022-04-22)


Expand Down
153 changes: 84 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zextras/carbonio-shell-ui",
"version": "0.4.11",
"version": "0.4.14",
"description": "The Zextras Carbonio web client",
"main": "dist/zapp-shell.bundle.js",
"types": "./types/index.d.ts",
Expand Down Expand Up @@ -100,7 +100,7 @@
"@sentry/browser": "^6.17.7",
"@tinymce/tinymce-react": "^3.13.0",
"@zextras/carbonio-design-system": "^0.3.0",
"@zextras/carbonio-ui-preview": "^0.1.3",
"@zextras/carbonio-ui-preview": "^0.1.4",
"darkreader": "4.9.44",
"history": "^5.2.0",
"i18next": "21.6.10",
Expand Down
3 changes: 2 additions & 1 deletion src/boot/app/shared-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import * as ZappUI from '@zextras/carbonio-design-system';
import * as StyledComponents from 'styled-components';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import * as Preview from '../../preview';
// import * as Preview from '../../preview';
import * as Preview from '@zextras/carbonio-ui-preview';

import { IShellWindow } from '../../../types';

Expand Down
11 changes: 10 additions & 1 deletion src/history/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { find, startsWith, replace, trim } from 'lodash';
import { useMemo, useCallback } from 'react';
import { useLocation, useHistory } from 'react-router-dom';
import { AppRoute, HistoryParams } from '../../types';
import { SEARCH_APP_ID } from '../constants';
import { useSearchStore } from '../search/search-store';
import { useRoutes, getRoutes } from '../store/app';
import { useContextBridge } from '../store/context-bridge';

Expand All @@ -23,7 +25,14 @@ export const useCurrentRoute = (): AppRoute | undefined => {
export const getCurrentRoute = (): AppRoute | undefined => {
const history = useContextBridge.getState().functions.getHistory?.();
const routes = getRoutes();
return find(routes, (r) => startsWith(trim(history.location.pathname, '/'), r.route));
const route = find(routes, (r) => startsWith(trim(history.location.pathname, '/'), r.route));
if (route?.route === SEARCH_APP_ID) {
return {
...route,
route: `${route.route}/${useSearchStore.getState().module}`
};
}
return route;
};

export const parseParams = (params: HistoryParams): To => {
Expand Down
Loading

0 comments on commit 4e5a05a

Please sign in to comment.