Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ahmed Bouhuolia
2020-10-17 19:12:20 +02:00
8 changed files with 60 additions and 52 deletions

View File

@@ -12,7 +12,7 @@ export default function AccountsTypesSelect({
}) {
// Filters accounts types items.
const filterAccountTypeItems = (query, accountType, _index, exactMatch) => {
const normalizedTitle = accountType.name.toLowerCase();
const normalizedTitle = accountType.label.toLowerCase();
const normalizedQuery = query.toLowerCase();
if (exactMatch) {
@@ -28,7 +28,7 @@ export default function AccountsTypesSelect({
};
const items = accountsTypes.map((type) => ({
id: type.id, name: type.name,
id: type.id, label: type.label,
}));
return (
@@ -36,7 +36,7 @@ export default function AccountsTypesSelect({
items={items}
selectedItemProp={'id'}
selectedItem={selectedTypeId}
labelProp={'name'}
labelProp={'label'}
defaultText={defaultSelectText}
onItemSelect={handleItemSelected}
itemPredicate={filterAccountTypeItems}

View File

@@ -66,14 +66,14 @@ export const fetchCustomers = ({ query }) => {
.then((response) => {
dispatch({
type: t.CUSTOMER_SET,
customers: response.data.customers.results,
customers: response.data.customers,
});
dispatch({
type: t.CUSTOMERS_PAGE_SET,
customers: response.data.customers.results,
customers: response.data.customers,
customViewId: response.data.customers.customViewId,
paginationMeta: response.data.customers.pagination,
paginationMeta: response.data.pagination,
});
dispatch({
type: t.CUSTOMERS_TABLE_LOADING,

View File

@@ -18,21 +18,21 @@ export const fetchExpensesTable = ({ query } = {}) => {
dispatch({
type: t.EXPENSES_PAGE_SET,
payload: {
expenses: response.data.expenses.results,
pagination: response.data.expenses.pagination,
expenses: response.data.expenses,
pagination: response.data.pagination,
customViewId: response.data.customViewId || -1,
},
});
dispatch({
type: t.EXPENSES_ITEMS_SET,
payload: {
expenses: response.data.expenses.results,
expenses: response.data.expenses,
}
});
dispatch({
type: t.EXPENSES_PAGINATION_SET,
payload: {
pagination: response.data.expenses.pagination,
pagination: response.data.pagination,
customViewId: response.data.customViewId || -1,
}
});

View File

@@ -23,7 +23,7 @@ export const fetchItemCategories = ({ query }) => {
.then((response) => {
dispatch({
type: t.ITEMS_CATEGORY_LIST_SET,
categories: response.data.categories,
categories: response.data.item_categories,
});
dispatch({
type: t.SET_DASHBOARD_REQUEST_COMPLETED,

View File

@@ -25,13 +25,13 @@ export const fetchItems = ({ query }) => {
.then((response) => {
dispatch({
type: t.ITEMS_SET,
items: response.data.items.results,
items: response.data.items,
});
dispatch({
type: t.ITEMS_PAGE_SET,
items: response.data.items.results,
items: response.data.items,
customViewId: response.data.customViewId,
paginationMeta: response.data.items.pagination,
paginationMeta: response.data.pagination,
});
dispatch({
type: t.ITEMS_TABLE_LOADING,

View File

@@ -5,7 +5,7 @@ import t from 'store/types';
export const makeJournalEntries = ({ form }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.post('accounting/make-journal-entries', form)
ApiService.post('manual-journals', form)
.then((response) => {
resolve(response);
})
@@ -21,13 +21,13 @@ export const makeJournalEntries = ({ form }) => {
export const fetchManualJournal = ({ id }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.get(`accounting/manual-journals/${id}`)
ApiService.get(`manual-journals/${id}`)
.then((response) => {
dispatch({
type: t.MANUAL_JOURNAL_SET,
payload: {
id,
manualJournal: response.data.manual_journal,
manualJournal: response.data.manualJournal,
},
});
resolve(response);
@@ -41,7 +41,7 @@ export const fetchManualJournal = ({ id }) => {
export const editManualJournal = ({ form, id }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.post(`accounting/manual-journals/${id}`, form)
ApiService.post(`manual-journals/${id}`, form)
.then((response) => {
resolve(response);
})
@@ -53,11 +53,10 @@ export const editManualJournal = ({ form, id }) => {
});
});
};
export const deleteManualJournal = ({ id }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.delete(`accounting/manual-journals/${id}`)
ApiService.delete(`manual-journals/${id}`)
.then((response) => {
dispatch({
type: t.MANUAL_JOURNAL_REMOVE,
@@ -74,7 +73,7 @@ export const deleteManualJournal = ({ id }) => {
export const deleteBulkManualJournals = ({ ids }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.delete('accounting/manual-journals', { params: { ids } })
ApiService.delete('manual-journals', { params: { ids } })
.then((response) => {
dispatch({
type: t.MANUAL_JOURNALS_BULK_DELETE,
@@ -91,7 +90,7 @@ export const deleteBulkManualJournals = ({ ids }) => {
export const publishManualJournal = ({ id }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.post(`accounting/manual-journals/${id}/publish`)
ApiService.post(`manual-journals/${id}/publish`)
.then((response) => {
dispatch({
type: t.MANUAL_JOURNAL_PUBLISH,
@@ -113,34 +112,37 @@ export const fetchManualJournalsTable = ({ query } = {}) => {
if (pageQuery.filter_roles) {
pageQuery = {
...omit(pageQuery, ['filter_roles']),
stringified_filter_roles: JSON.stringify(pageQuery.filter_roles) || '',
stringified_filter_roles:
JSON.stringify(pageQuery.filter_roles) || '',
};
}
dispatch({
type: t.MANUAL_JOURNALS_TABLE_LOADING,
loading: true,
});
ApiService.get('accounting/manual-journals', {
ApiService.get('manual-journals', {
params: { ...pageQuery, ...query },
})
.then((response) => {
dispatch({
type: t.MANUAL_JOURNALS_PAGE_SET,
payload: {
manualJournals: response.data.manualJournals.results,
customViewId: response.data.manualJournals?.viewMeta?.customViewId || -1,
pagination: response.data.manualJournals.pagination,
}
manualJournals: response.data.manual_journals,
customViewId:
response.data.manual_journals?.viewMeta?.customViewId || -1,
pagination: response.data.pagination,
},
});
dispatch({
type: t.MANUAL_JOURNALS_ITEMS_SET,
manual_journals: response.data.manualJournals.results,
manual_journals: response.data.manual_journals,
});
dispatch({
type: 'MANUAL_JOURNALS_PAGINATION_SET',
payload: {
pagination: response.data.manualJournals.pagination,
customViewId: response.data.manualJournals?.viewMeta?.customViewId || -1,
pagination: response.data.pagination,
customViewId:
response.data.manual_journals?.viewMeta?.customViewId || -1,
},
});
dispatch({

View File

@@ -15,21 +15,21 @@ export const fetchVendorsTable = ({ query }) => {
dispatch({
type: t.VENDORS_PAGE_SET,
payload: {
vendors: response.data.vendors.results,
pagination: response.data.vendors.pagination,
vendors: response.data.vendors,
pagination: response.data.pagination,
customViewId: response.data.customViewId,
},
});
dispatch({
type: t.VENDORS_ITEMS_SET,
payload: {
vendors: response.data.vendors.results,
vendors: response.data.vendors,
},
});
dispatch({
type: t.VENDORS_PAGINATION_SET,
payload: {
pagination: response.data.vendors.pagination,
pagination: response.data.pagination,
customViewId: response.data.customViewId || -1,
},
});
@@ -49,10 +49,8 @@ export const fetchVendorsTable = ({ query }) => {
export const editVendor = ({ form, id }) => {
return (dispatch) =>
new Promise((resolve, reject) => {
ApiService.post(`vendors/${id}`, form)
.then((response) => {
resolve(response);
})
.catch((error) => {

View File

@@ -19,7 +19,7 @@
font-size: 22px;
}
h1,
h3{
h3 {
font-weight: 500;
color: #6b7382;
}
@@ -195,7 +195,7 @@
margin: 0 auto;
padding: 45px 0 20px;
&__title-wrap{
&__title-wrap {
margin-bottom: 32px;
h1 {
@@ -203,12 +203,12 @@
margin-bottom: 10px;
color: #565e6c;
}
.paragraph{
.paragraph {
opacity: 0.75;
}
}
&__form{
&__form {
h3 {
margin-bottom: 1rem;
}
@@ -222,12 +222,21 @@
}
}
.form-group--language {
margin-left: 10px;
}
.bp3-button:not([class*='bp3-intent-']):not(.bp3-minimal) {
width: 100%;
height: 38px;
padding: 8px;
}
.register-org-note{
.bp3-text-muted {
color: #000000;
}
.register-org-note {
font-size: 13px;
padding-bottom: 10px;
border-bottom: 1px solid #e1e1e1;
@@ -282,33 +291,32 @@
width: 70%;
margin: 0 auto;
color: #2e4266;
}
}
}
}
.setup-congrats{
.setup-congrats {
width: 600px;
margin: 0 auto;
text-align: center;
padding-top: 80px;
&__page{
&__page {
}
&__text{
&__text {
margin-top: 30px;
h1{
color: #2D2B43;
h1 {
color: #2d2b43;
margin-bottom: 12px;
}
.paragraph{
.paragraph {
font-size: 15px;
opacity: 0.85;
margin-bottom: 14px;
}
.bp3-button{
.bp3-button {
height: 38px;
padding-left: 25px;
padding-right: 25px;
@@ -316,4 +324,4 @@
margin-top: 12px;
}
}
}
}