mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
feat(transactions-locking): enable settings schema and add dark mode support
This commit is contained in:
@@ -1,4 +1,27 @@
|
|||||||
// import { getTransactionsLockingSettingsSchema } from '@/api/controllers/TransactionsLocking/utils';
|
import { chain, mapKeys } from 'lodash';
|
||||||
|
|
||||||
|
const getTransactionsLockingSettingsSchema = (modules: string[]) => {
|
||||||
|
const moduleSchema = {
|
||||||
|
active: { type: 'boolean' },
|
||||||
|
lock_to_date: { type: 'date' },
|
||||||
|
unlock_from_date: { type: 'date' },
|
||||||
|
unlock_to_date: { type: 'date' },
|
||||||
|
lock_reason: { type: 'string' },
|
||||||
|
unlock_reason: { type: 'string' },
|
||||||
|
};
|
||||||
|
return chain(modules)
|
||||||
|
.map((module: string) => {
|
||||||
|
return mapKeys(moduleSchema, (value, key: string) => `${module}.${key}`);
|
||||||
|
})
|
||||||
|
.flattenDeep()
|
||||||
|
.reduce((result, value) => {
|
||||||
|
return {
|
||||||
|
...result,
|
||||||
|
...value,
|
||||||
|
};
|
||||||
|
}, {})
|
||||||
|
.value();
|
||||||
|
};
|
||||||
|
|
||||||
export const SettingsOptions = {
|
export const SettingsOptions = {
|
||||||
organization: {
|
organization: {
|
||||||
@@ -223,12 +246,12 @@ export const SettingsOptions = {
|
|||||||
'locking-type': {
|
'locking-type': {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
},
|
},
|
||||||
// ...getTransactionsLockingSettingsSchema([
|
...getTransactionsLockingSettingsSchema([
|
||||||
// 'all',
|
'all',
|
||||||
// 'sales',
|
'sales',
|
||||||
// 'purchases',
|
'purchases',
|
||||||
// 'financial',
|
'financial',
|
||||||
// ]),
|
]),
|
||||||
},
|
},
|
||||||
features: {
|
features: {
|
||||||
'multi-warehouses': {
|
'multi-warehouses': {
|
||||||
|
|||||||
@@ -364,13 +364,18 @@ const TransLockingItemDesc = styled.p`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const TransLockingIcon = styled.div`
|
const TransLockingIcon = styled.div`
|
||||||
|
--x-text-color: #93a1ba;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-text-color: rgba(255, 255, 255, 0.6);
|
||||||
|
}
|
||||||
border: 1px solid var(--color-transaction-locking-item-icon-border);
|
border: 1px solid var(--color-transaction-locking-item-icon-border);
|
||||||
height: 45px;
|
height: 45px;
|
||||||
width: 45px;
|
width: 45px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 45px;
|
line-height: 45px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
color: #93a1ba;
|
color: var(--x-text-color);
|
||||||
|
|
||||||
.bp4-icon {
|
.bp4-icon {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -395,15 +400,24 @@ export const TransLockingContent = styled.div`
|
|||||||
|
|
||||||
export const TransLockingReason = styled.div`
|
export const TransLockingReason = styled.div`
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
--x-text-color: #777;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-text-color: rgba(255, 255, 255, 0.6);
|
||||||
|
}
|
||||||
strong {
|
strong {
|
||||||
color: #777;
|
color: var(--x-text-color);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TransUnlockWrap = styled.div`
|
const TransUnlockWrap = styled.div`
|
||||||
|
-x-border-color: #ddd;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-border-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid var(--x-border-color);
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
${TransLockingReason} {
|
${TransLockingReason} {
|
||||||
|
|||||||
Reference in New Issue
Block a user