+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/client/src/components/Sidebar/SidebarContainer.js b/client/src/components/Sidebar/SidebarContainer.js
index 77c0c670f..35395c907 100644
--- a/client/src/components/Sidebar/SidebarContainer.js
+++ b/client/src/components/Sidebar/SidebarContainer.js
@@ -1,11 +1,70 @@
-import React from 'react';
+import * as React from 'react';
+import { Scrollbar } from 'react-scrollbars-custom';
+
+const style = {
+ holder: {
+ position: 'relative',
+ width: '100%',
+ height: '100%',
+ },
+
+ wrapper: {
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ bottom: 0,
+ right: 0,
+ },
+
+ content: {
+ boxSizing: 'border-box',
+ },
+
+ track: {
+ common: {
+ position: 'absolute',
+ overflow: 'hidden',
+ borderRadius: 4,
+ background: 'rgba(0,0,0,.1)',
+ userSelect: 'none',
+ },
+ x: {
+ height: 10,
+ width: 'calc(100% - 20px)',
+ bottom: 0,
+ left: 10,
+ },
+ y: {
+ width: 10,
+ height: 'calc(100% - 20px)',
+ top: 10,
+ },
+ },
+
+ thumb: {
+ common: {
+ cursor: 'pointer',
+ borderRadius: 4,
+ background: 'rgba(0,0,0,.4)',
+ },
+ x: {
+ height: '100%',
+ width: 0,
+ },
+ y: {
+ width: '100%',
+ height: 0,
+ },
+ },
+};
export default function SidebarContainer(props) {
return (
-
diff --git a/client/src/containers/Dashboard/Preferences/UsersList.js b/client/src/containers/Dashboard/Preferences/UsersList.js
index 9971eec5b..5eefd0b1d 100644
--- a/client/src/containers/Dashboard/Preferences/UsersList.js
+++ b/client/src/containers/Dashboard/Preferences/UsersList.js
@@ -1,10 +1,6 @@
-import React, {useState} from 'react';
-import {useAsync} from 'react-use';
-import {
- GridComponent,
- ColumnsDirective,
- ColumnDirective,
-} from '@syncfusion/ej2-react-grids';
+import React, { useState, useMemo, useCallback } from 'react';
+import { useAsync } from 'react-use';
+import DataTable from 'components/DataTable';
import {
Alert,
Popover,
@@ -17,9 +13,12 @@ import {
} from '@blueprintjs/core';
import Icon from 'components/Icon';
import LoadingIndicator from 'components/LoadingIndicator';
-import {snakeCase} from 'lodash';
-import connector from 'connectors/UsersList.connector';
+import { snakeCase } from 'lodash';
+import UserListConnect from 'connectors/UsersList.connector';
import AppToaster from 'components/AppToaster';
+import { compose } from 'utils';
+import DialogConnect from 'connectors/Dialog.connector';
+import DashboardConnect from 'connectors/Dashboard.connector';
function UsersListPreferences({
fetchUsers,
@@ -27,22 +26,23 @@ function UsersListPreferences({
openDialog,
closeDialog,
deleteUser,
+ onFetchData,
}) {
const [deleteUserState, setDeleteUserState] = useState(false);
const [inactiveUserState, setInactiveUserState] = useState(false);
const asyncHook = useAsync(async () => {
- await Promise.all([
- fetchUsers(),
- ]);
+ await Promise.all([fetchUsers()]);
}, []);
- const onInactiveUser = (user) => {
+ const onInactiveUser = (user) => {};
+ const onDeleteUser = (user) => {
+ setDeleteUserState(user);
+ };
+ const handleCancelUserDelete = () => {
+ setDeleteUserState(false);
};
-
- const onDeleteUser = (user) => { setDeleteUserState(user); };
- const handleCancelUserDelete = () => { setDeleteUserState(false); };
const onEditUser = (user) => () => {
const form = Object.keys(user).reduce((obj, key) => {
@@ -51,11 +51,13 @@ function UsersListPreferences({
return obj;
}, {});
- openDialog('user-form', { action: 'edit', user: form, });
+ openDialog('user-form', { action: 'edit', user: form });
};
const handleConfirmUserDelete = () => {
- if (!deleteUserState) { return; }
+ if (!deleteUserState) {
+ return;
+ }
deleteUser(deleteUserState.id).then((response) => {
setDeleteUserState(false);
@@ -65,79 +67,96 @@ function UsersListPreferences({
});
};
- const actionMenuList = (user) =>
- (
+ );
+ console.log(usersList, 'X');
+
+ const columns = useMemo(
+ () => [
+ {
+ id: 'full_name',
+ Header: 'Full Name',
+ accessor: 'full_name',
+ width: 170,
+ },
+ {
+ id: 'email',
+ Header: 'Email',
+ accessor: 'email',
+ width: 150,
+ },
+ {
+ id: 'phone_number',
+ Header: 'Phone Number',
+ accessor: 'phone_number',
+ width: 150,
+ },
+ {
+ id: 'active',
+ Header: 'Status',
+ accessor: (user) =>
+ user.active ?
Active :
Inactivate,
+ width: 50,
+ },
+ {
+ id: 'actions',
+ Header: '',
+ Cell: ({ cell }) => (
+
+ } />
+
+ ),
+ className: 'actions',
+ width: 50,
+ },
+ ],
+ [actionMenuList]
+ );
+
+ const handelDataTableFetchData = useCallback(() => {
+ onFetchData && onFetchData();
+ }, []);
- const columns = [
- {
- field: '',
- headerText: 'Avatar',
- },
- {
- field: 'fullName',
- headerText: 'Full Name',
- },
- {
- field: 'email',
- headerText: 'Email',
- },
- {
- field: 'phoneNumber',
- headerText: 'Phone Number',
- },
- {
- field: '',
- headerText: 'Status',
- template: (user) => user.active
- ? (
Active) : (
Inactive)
- },
- {
- template: (user) => (
-
- } />
-
- ),
- }
- ]
return (
-
-
-
-
- {columns.map((column) => {
- return ();
- })}
-
-
+
+
+ onConfirm={handleConfirmUserDelete}
+ >
- Are you sure you want to move filename to Trash? You will be able to restore it later,
- but it will become private to you.
+ Are you sure you want to move filename to Trash? You will be
+ able to restore it later, but it will become private to you.
);
}
-export default connector(UsersListPreferences);
\ No newline at end of file
+export default compose(
+ UserListConnect,
+ DialogConnect,
+ DashboardConnect
+)(UsersListPreferences);
diff --git a/client/src/store/itemCategories/itemsCategory.type.js b/client/src/store/itemCategories/itemsCategory.type.js
index 84470100c..a9868d08e 100644
--- a/client/src/store/itemCategories/itemsCategory.type.js
+++ b/client/src/store/itemCategories/itemsCategory.type.js
@@ -2,5 +2,6 @@ export default {
ITEMS_CATEGORY_LIST_SET: 'ITEMS_CATEGORY_LIST_SET',
ITEMS_CATEGORY_DATA_TABLE: 'ITEMS_CATEGORY_DATA_TABLE',
CATEGORY_DELETE: 'CATEGORY_DELETE',
- CLEAR_CATEGORY_FORM_ERRORS: 'CLEAR_CATEGORY_FORM_ERRORS'
+ CLEAR_CATEGORY_FORM_ERRORS: 'CLEAR_CATEGORY_FORM_ERRORS',
+ CATEGORY_COUNTER:'CATEGORY_COUNTER'
};
diff --git a/client/src/store/settings/settings.actions.js b/client/src/store/settings/settings.actions.js
index e69de29bb..608241584 100644
--- a/client/src/store/settings/settings.actions.js
+++ b/client/src/store/settings/settings.actions.js
@@ -0,0 +1,25 @@
+import ApiService from 'services/ApiService';
+import t from 'store/types';
+
+export const submitOptions = ({ form }) => {
+ return (dispatch) => {
+ return ApiService.post('options', form);
+ };
+};
+
+export const FetchOptions = ({ form }) => {
+ return (dispatch) =>
+ new Promise((resolve, reject) => {
+ ApiService.get('options')
+ .then((response) => {
+ dispatch({
+ type: t.SETTING_SET,
+ options: response.data.options,
+ });
+ resolve(response);
+ })
+ .catch((error) => {
+ reject(error);
+ });
+ });
+};
diff --git a/client/src/store/settings/settings.reducer.js b/client/src/store/settings/settings.reducer.js
index fb03fba8f..37e7c68e0 100644
--- a/client/src/store/settings/settings.reducer.js
+++ b/client/src/store/settings/settings.reducer.js
@@ -1,16 +1,16 @@
import { createReducer } from '@reduxjs/toolkit';
import t from 'store/types';
-
+import { optionsArrayToMap } from 'utils';
const initialState = {
data: {
- organization: {
- name: 'Bigcapital, Limited Liabilities',
- },
+ organization: {},
},
};
export default createReducer(initialState, {
- ['asdfas']: (state, action) => {
-
+ [t.SETTING_SET]: (state, action) => {
+ const { options } = action;
+
+ state.data.organization = optionsArrayToMap(options);
},
-});
\ No newline at end of file
+});
diff --git a/client/src/store/settings/settings.type.js b/client/src/store/settings/settings.type.js
index 7a62d56e8..fac8d63a5 100644
--- a/client/src/store/settings/settings.type.js
+++ b/client/src/store/settings/settings.type.js
@@ -1,5 +1,5 @@
-
-
export default {
-
-};
\ No newline at end of file
+ SETTING_LIST_SET: 'SETTING_LIST_SET',
+ CLEAR_OPTIONS_FORM_ERRORS: 'CLEAR_OPTIONS_FORM_ERRORS',
+ SETTING_SET: 'SETTING_SET',
+};
diff --git a/client/src/store/users/users.reducer.js b/client/src/store/users/users.reducer.js
index d897d0d63..4c28ddc67 100644
--- a/client/src/store/users/users.reducer.js
+++ b/client/src/store/users/users.reducer.js
@@ -1,8 +1,10 @@
-import { createReducer } from "@reduxjs/toolkit";
+import { createReducer } from '@reduxjs/toolkit';
import t from 'store/types';
const initialState = {
- list: {},
+ list: {
+ results: [],
+ },
userById: {},
};
@@ -14,13 +16,13 @@ export default createReducer(initialState, {
[t.USER_DETAILS_SET]: (state, action) => {
state.userById[action.user.id] = action.user;
},
-})
+});
/**
* Retrieve the user details of the given user id,
- * @param {Object} state
- * @param {Numeric} id
+ * @param {Object} state
+ * @param {Numeric} id
*/
export const getUserDetails = (state, id) => {
return state.users.userById[id];
-};
\ No newline at end of file
+};
diff --git a/client/src/style/App.scss b/client/src/style/App.scss
index 27eef9ca4..ba4bb6ca8 100644
--- a/client/src/style/App.scss
+++ b/client/src/style/App.scss
@@ -1,9 +1,9 @@
+@import './normalize.scss';
-@import "./normalize.scss";
+$pt-popover-box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.02),
+ 0 2px 4px rgba(16, 22, 26, 0.1), 0 8px 24px rgba(16, 22, 26, 0.1);
-$pt-popover-box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.02), 0 2px 4px rgba(16, 22, 26, 0.1), 0 8px 24px rgba(16, 22, 26, 0.1);
-
-@import "@blueprintjs/core/src/common/_variables.scss";
+@import '@blueprintjs/core/src/common/_variables.scss';
// @import "@blueprintjs/core/src/common/colors.scss";
$menu-item-color-hover: $light-gray4;
@@ -12,41 +12,43 @@ $menu-item-color-active: $light-gray3;
$breadcrumbs-collapsed-icon: url("data:image/svg+xml,");
// Blueprint framework.
-@import "@blueprintjs/core/src/blueprint.scss";
-@import "@blueprintjs/datetime/src/blueprint-datetime.scss";
+@import '@blueprintjs/core/src/blueprint.scss';
+@import '@blueprintjs/datetime/src/blueprint-datetime.scss';
-@import "basscss";
+@import 'basscss';
-$pt-font-family: Noto Sans, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, Icons16, sans-serif;
+$pt-font-family: Noto Sans, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
+ Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, Icons16, sans-serif;
-@import "functions";
+@import 'functions';
// Objects
-@import "objects/form";
-@import "objects/typography";
-@import "objects/buttons";
+@import 'objects/form';
+@import 'objects/typography';
+@import 'objects/buttons';
// Components
-@import "components/data-table";
-@import "components/dialog";
-
+@import 'components/data-table';
+@import 'components/dialog';
+
// Pages
-@import "pages/dashboard";
-@import "pages/accounts-chart";
-@import "pages/authentication";
-@import "pages/expense-form";
-@import "pages/financial-statements";
-@import "pages/make-journal-entries";
-@import "pages/preferences";
-@import "pages/view-form";
-@import "pages/manual-journals";
-@import "pages/item-category";
-@import "pages/items";
+@import 'pages/dashboard';
+@import 'pages/accounts-chart';
+@import 'pages/authentication';
+@import 'pages/expense-form';
+@import 'pages/financial-statements';
+@import 'pages/make-journal-entries';
+@import 'pages/preferences';
+@import 'pages/view-form';
+@import 'pages/manual-journals';
+@import 'pages/item-category';
+@import 'pages/items';
+@import 'pages/invite-form.scss';
// Views
-@import "views/filter-dropdown";
-@import "views/sidebar";
+@import 'views/filter-dropdown';
+@import 'views/sidebar';
-.#{$ns}-tooltip{
+.#{$ns}-tooltip {
box-shadow: none;
-}
\ No newline at end of file
+}
diff --git a/client/src/style/pages/invite-form.scss b/client/src/style/pages/invite-form.scss
new file mode 100644
index 000000000..054bfe527
--- /dev/null
+++ b/client/src/style/pages/invite-form.scss
@@ -0,0 +1,47 @@
+// .dialog--invite-form {
+
+// }
+
+.dialog--invite-form {
+ &.bp3-dialog {
+ width: 400px;
+ }
+ &:not(.dialog--loading) .bp3-dialog-body {
+ margin-bottom: 25px;
+ }
+ .bp3-dialog-body {
+ // margin-right: 50px;
+ .bp3-form-group.bp3-inline {
+ .bp3-label {
+ min-width: 70px;
+ }
+
+ &.form-group--email {
+ .bp3-form-content {
+ width: 250px;
+ }
+ }
+ }
+ .bp3-dialog-footer-actions {
+ margin-right: 30px;
+ display: flex;
+ justify-content: flex-end;
+ }
+ }
+}
+
+// .bp3-dialog-body {
+// .bp3-form-group.bp3-inline {
+// .bp3-label {
+// min-width: 100px;
+// }
+// .bp3-form-content {
+// width: 250px;
+// }
+// }
+// }
+// .bp3-dialog-footer-actions {
+// display: flex;
+// justify-content: flex-end;
+// margin-right: 100px;
+// }
diff --git a/client/src/style/pages/preferences.scss b/client/src/style/pages/preferences.scss
index 31f544205..39459d673 100644
--- a/client/src/style/pages/preferences.scss
+++ b/client/src/style/pages/preferences.scss
@@ -90,3 +90,7 @@
}
}
}
+.preferences__tabs-extra-actions {
+ position: absolute;
+ right: 0;
+}
diff --git a/client/src/style/views/Sidebar.scss b/client/src/style/views/Sidebar.scss
index 974829987..05e3c74c5 100644
--- a/client/src/style/views/Sidebar.scss
+++ b/client/src/style/views/Sidebar.scss
@@ -1,117 +1,191 @@
-
-$sidebar-background: #01194E;
+$sidebar-background: #01194e;
$sidebar-text-color: #fff;
$sidebar-width: 220px;
$sidebar-menu-item-color: #b8c0d5;
$sidebar-popover-submenu-bg: rgb(1, 20, 62);
+.ScrollbarsCustom {
+ position: 'relative';
+ width: 100%;
+ height: 100%;
+}
-.sidebar{
+.ScrollbarsCustom-Wrapper {
+ position: 'absolute';
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+}
+
+.ScrollbarsCustom-Content {
+ box-sizing: 'border-box';
+}
+
+.ScrollbarsCustom-Track {
+ &.ScrollbarsCustom-TrackY,
+ &.ScrollbarsCustom-TrackX {
+ position: absolute;
+ overflow: hidden;
+ border-radius: 4px;
+ background: rgba(0, 0, 0, 0.1);
+ user-select: none;
+ }
+ &.ScrollbarsCustom-TrackX {
+ height: 10px;
+ width: calc(100% - 20px);
+ bottom: 0;
+ left: 10px;
+ }
+ &.ScrollbarsCustom-TrackY {
+ width: 10px;
+ height: calc(100% - 20px);
+ top: 10px;
+ }
+}
+.ScrollbarsCustom-Thumb {
+ &.ScrollbarsCustom-ThumbX,
+ &.ScrollbarsCustom-ThumbY {
+ cursor: pointer;
+ border-radius: 4px;
+ background: rgba(255, 0, 0, 1);
+ }
+ &.ScrollbarsCustom-ThumbX {
+ height: 100%;
+ width: 0px;
+ }
+ &.ScrollbarsCustom-ThumbY {
+ height: 100%;
+ width: 0px;
+ }
+}
+.sidebar {
background: $sidebar-background;
color: $sidebar-text-color;
width: $sidebar-width;
position: fixed;
height: 100%;
- &__inner{
- overflow-y: scroll;
- overflow-x: hidden;
- height: 100%;
+ // ::-webkit-scrollbar {
+ // width: 14px;
+ // background: transparent;
+ // }
+ // ::-webkit-scrollbar-thumb {
+ // background-clip: content-box;
+ // border: 4px solid transparent;
+ // border-radius: 7px;
+ // box-shadow: inset 0 0 0 10px;
+ // }
+ // ::-webkit-scrollbar-button {
+ // width: 0;
+ // height: 0;
+ // display: none;
+ // }
+
+ // overflow: auto;
+ // color: #ff000000;
+ // transition: color 0.3s;
+
+ &:hover {
+ color: rgba(255, 255, 255, 0.35);
}
+ // &__inner {
+ // overflow-y: scroll;
+ // overflow-x: hidden;
+ // height: 100%;
+ // }
- &__head{
+ &__head {
padding: 16px 10px;
-
- &-company-meta{
- .company-name{
+ &-company-meta {
+ .company-name {
font-size: 16px;
font-weight: 200;
margin-bottom: 5px;
color: rgba(255, 255, 255, 0.75);
}
- .company-meta{
+ .company-meta {
color: rgba(255, 255, 255, 0.4);
font-size: 12px;
}
}
}
- &-menu{
+ &-menu {
background: transparent;
padding: 0;
min-width: $sidebar-width;
border-radius: 0;
padding-bottom: 2rem;
- .#{$ns}-menu-item{
+ .#{$ns}-menu-item {
color: $sidebar-menu-item-color;
border-radius: 0;
padding: 10px 16px;
font-size: 15px;
- font-weight: 400;
+ font-weight: 400;
&:hover,
- &.bp3-active{
+ &.bp3-active {
background: #012470;
color: #c1c9dd;
}
&:focus,
- &:active{
- background: #01143e;
+ &:active {
+ background: #01143e;
}
- > .#{$ns}-icon{
+ > .#{$ns}-icon {
color: #767b9b;
margin-right: 14px;
margin-top: 0;
}
- > .#{$ns}-icon-caret-right{
+ > .#{$ns}-icon-caret-right {
margin-right: -4px;
margin-top: 3px;
color: #42547b;
}
}
- .#{$ns}-submenu{
-
- .#{$ns}-collapse{
+ .#{$ns}-submenu {
+ .#{$ns}-collapse {
border-left: 2px solid rgba(255, 255, 255, 0.15);
- &-body{
+ &-body {
background-color: rgb(11, 34, 85);
padding-bottom: 6px;
padding-top: 6px;
}
- .#{$ns}-menu-item{
+ .#{$ns}-menu-item {
padding: 7px 16px 7px 18px;
font-size: 15px;
color: #8a95b6;
&:hover,
- &.bp3-active{
+ &.bp3-active {
background: transparent;
- color: #C5CBE3;
+ color: #c5cbe3;
}
}
}
- .#{$ns}-popover{
+ .#{$ns}-popover {
padding: 0;
- &-content{
+ &-content {
box-shadow: 0 0 0;
}
}
}
- .#{$ns}-popover-target.#{$ns}-popover-open .#{$ns}-menu-item{
+ .#{$ns}-popover-target.#{$ns}-popover-open .#{$ns}-menu-item {
color: $sidebar-menu-item-color;
}
- .#{$ns}-menu-divider{
- border-top-color: #1D366A;
- color: #6B708C;
+ .#{$ns}-menu-divider {
+ border-top-color: #1d366a;
+ color: #6b708c;
margin: 4px 0;
}
}
-}
\ No newline at end of file
+}