diff --git a/client/src/components/Dashboard/Dashboard.js b/client/src/components/Dashboard/Dashboard.js index e710485a6..255262b44 100644 --- a/client/src/components/Dashboard/Dashboard.js +++ b/client/src/components/Dashboard/Dashboard.js @@ -1,27 +1,30 @@ import React from 'react'; -import {Switch, Route} from 'react-router'; +import { Switch, Route } from 'react-router'; import Sidebar from 'components/Sidebar/Sidebar'; import DashboardContent from 'components/Dashboard/DashboardContent'; import DialogsContainer from 'components/DialogsContainer'; import PreferencesContent from 'components/Preferences/PreferencesContent'; import PreferencesSidebar from 'components/Preferences/PreferencesSidebar'; +import Search from 'containers/Dashboard/GeneralSearch/Search'; -export default function() { +export default function () { return ( -
+
- + - + + +
); -} \ No newline at end of file +} diff --git a/client/src/components/Dashboard/DashboardTopbar.js b/client/src/components/Dashboard/DashboardTopbar.js index 7b551f7fa..4259107e1 100644 --- a/client/src/components/Dashboard/DashboardTopbar.js +++ b/client/src/components/Dashboard/DashboardTopbar.js @@ -6,17 +6,20 @@ import { NavbarGroup, Button, Classes, - MenuDivider, - MenuItem, - Menu, - Popover, } from '@blueprintjs/core'; import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs'; import DashboardTopbarUser from 'components/Dashboard/TopbarUser'; import Icon from 'components/Icon'; -import Search from 'containers/Dashboard/GeneralSearch/Search'; +import SearchConnect from 'connectors/Search.connect'; +import { compose } from 'utils'; -function DashboardTopbar({ pageTitle, pageSubtitle, editViewId }) { +function DashboardTopbar({ + pageTitle, + pageSubtitle, + editViewId, + globalSearchShow, + openGlobalSearch, +}) { const history = useHistory(); const handlerClickEditView = () => { @@ -70,8 +73,13 @@ function DashboardTopbar({ pageTitle, pageSubtitle, editViewId }) {
- {/*
); diff --git a/client/src/store/reducers.js b/client/src/store/reducers.js index 47cb60597..d476baf29 100644 --- a/client/src/store/reducers.js +++ b/client/src/store/reducers.js @@ -14,7 +14,7 @@ import financialStatements from './financialStatement/financialStatements.reduce import itemCategories from './itemCategories/itemsCategory.reducer'; import settings from './settings/settings.reducer'; import manualJournals from './manualJournals/manualJournals.reducers'; -import search from './search/search.reducer'; +import globalSearch from './search/search.reducer'; export default combineReducers({ authentication, @@ -31,5 +31,5 @@ export default combineReducers({ items, itemCategories, settings, - search, + globalSearch, }); diff --git a/client/src/store/search/search.actions.js b/client/src/store/search/search.actions.js index e9bceac84..b1d3a44ed 100644 --- a/client/src/store/search/search.actions.js +++ b/client/src/store/search/search.actions.js @@ -1,5 +1,19 @@ import t from 'store/types'; +export function openSearch(result) { + return { + type: t.OPEN_SEARCH, + result, + }; +} + +export function closeSearch(result) { + return { + type: t.ClOSE_SEARCH, + result, + }; +} + export function generalSearch(name, result) { return { type: t.SEARCH_SUCCESS, diff --git a/client/src/store/search/search.reducer.js b/client/src/store/search/search.reducer.js index 583f12123..4badabd3a 100644 --- a/client/src/store/search/search.reducer.js +++ b/client/src/store/search/search.reducer.js @@ -8,26 +8,11 @@ const initialState = { }; export default createReducer(initialState, { - [t.SEARCH_SUCCESS]: (state, action) => { - const _result = {}; - - action.searches.forEach((search) => { - _result[search.id] = search; - }); - - state.searches = { - ...state.searches, - ..._result, - }; + [t.OPEN_SEARCH]: (state, action) => { + state.isOpen = true; }, -}); -// return state = action.result; -// if (typeof state === 'undefined') { -// return initialState; -// } - -// state.search[action.name] = { -// isOpen: true, -// payload: action.payload || {}, -// }; + [t.CLOSE_SEARCH]: (state, action) => { + state.isOpen = false; + } +}); \ No newline at end of file diff --git a/client/src/store/search/search.type.js b/client/src/store/search/search.type.js index 9dc5162e7..e9c47a60f 100644 --- a/client/src/store/search/search.type.js +++ b/client/src/store/search/search.type.js @@ -1,5 +1,5 @@ export default { - SEARCH_SUCCESS: 'SEARCH_SUCCESS', - SEARCH_FAILURE: 'SEARCH_FAILURE', - SEARCH_REQUEST: 'SEARCH_REQUEST', + SEARCH_SUCCESS:'SEARCH_SUCCESS', + OPEN_SEARCH: 'OPEN_SEARCH', + CLOSE_SEARCH: 'CLOSE_SEARCH', }; diff --git a/client/src/store/types.js b/client/src/store/types.js index 28fc76b9f..ef00f5c29 100644 --- a/client/src/store/types.js +++ b/client/src/store/types.js @@ -14,6 +14,7 @@ import financialStatements from './financialStatement/financialStatements.types' import itemCategories from './itemCategories/itemsCategory.type'; import settings from './settings/settings.type'; import search from './search/search.type'; + export default { ...authentication, ...accounts, diff --git a/client/src/style/pages/dashboard.scss b/client/src/style/pages/dashboard.scss index 3ca74dc43..292a85f53 100644 --- a/client/src/style/pages/dashboard.scss +++ b/client/src/style/pages/dashboard.scss @@ -273,4 +273,20 @@ .navbar--dashboard-views{ box-shadow: 0 0 0; border-bottom: 1px solid #EAEAEA; +} + +.navbar-omnibar{ + -webkit-filter: blur(0); + filter: blur(0); + opacity: 1; + top: 20vh; + left: calc(50% - 250px); + z-index: 21; + border-radius: 3px; + -webkit-box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), + 0 4px 8px rgba(16, 22, 26, 0.2), 0 18px 46px 6px rgba(16, 22, 26, 0.2); + box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 4px 8px rgba(16, 22, 26, 0.2), + 0 18px 46px 6px rgba(16, 22, 26, 0.2); + background-color: #fff; + width: 500px; } \ No newline at end of file