|
|
|
@ -35,6 +35,7 @@ const parseJson = (str) => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const statesForHideEdited = [1, 2];
|
|
|
|
|
export const columnsSets = (t, colorize = true) => [
|
|
|
|
|
{
|
|
|
|
|
key: 'adult',
|
|
|
|
@ -42,7 +43,7 @@ export const columnsSets = (t, colorize = true) => [
|
|
|
|
|
width: '12rem',
|
|
|
|
|
render: (_, { adult_cost, currency, unit_id, unit_name, audit_state_id, lastedit_changed }) => {
|
|
|
|
|
const _changed = parseJson(lastedit_changed);
|
|
|
|
|
const ifCompare = colorize && ![-1, 1, 2].includes(audit_state_id);
|
|
|
|
|
const ifCompare = colorize && !statesForHideEdited.includes(audit_state_id);
|
|
|
|
|
const ifData = isNotEmpty(_changed.adult_cost) || isNotEmpty(_changed.unit_id) || isNotEmpty(_changed.currency);
|
|
|
|
|
const preValue =
|
|
|
|
|
ifCompare && ifData ? (
|
|
|
|
@ -63,7 +64,7 @@ export const columnsSets = (t, colorize = true) => [
|
|
|
|
|
width: '12rem',
|
|
|
|
|
render: (_, { child_cost, currency, unit_id, unit_name, audit_state_id, lastedit_changed }) => {
|
|
|
|
|
const _changed = parseJson(lastedit_changed);
|
|
|
|
|
const ifCompare = colorize && ![-1, 1, 2].includes(audit_state_id);
|
|
|
|
|
const ifCompare = colorize && !statesForHideEdited.includes(audit_state_id);
|
|
|
|
|
const ifData = isNotEmpty(_changed.child_cost) || isNotEmpty(_changed.unit_id) || isNotEmpty(_changed.currency);
|
|
|
|
|
const preValue =
|
|
|
|
|
ifCompare && ifData ? (
|
|
|
|
@ -87,10 +88,10 @@ export const columnsSets = (t, colorize = true) => [
|
|
|
|
|
render: (_, { audit_state_id, group_size_min, group_size_max, lastedit_changed }) => {
|
|
|
|
|
const _changed = parseJson(lastedit_changed);
|
|
|
|
|
const preValue =
|
|
|
|
|
colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? (
|
|
|
|
|
colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? (
|
|
|
|
|
<div className='text-muted line-through '>{`${_changed.group_size_min ?? group_size_min} - ${_changed.group_size_max ?? group_size_max}`}</div>
|
|
|
|
|
) : null;
|
|
|
|
|
const editCls = colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? 'text-danger' : '';
|
|
|
|
|
const editCls = colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? 'text-danger' : '';
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{preValue}
|
|
|
|
@ -107,13 +108,13 @@ export const columnsSets = (t, colorize = true) => [
|
|
|
|
|
render: (_, { use_dates_start, use_dates_end, weekdays, audit_state_id, lastedit_changed }) => {
|
|
|
|
|
const _changed = parseJson(lastedit_changed);
|
|
|
|
|
const preValue =
|
|
|
|
|
colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? (
|
|
|
|
|
colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? (
|
|
|
|
|
<div className='text-muted'>
|
|
|
|
|
{isNotEmpty(_changed.use_dates_start) ? <span className=' line-through '>{_changed.use_dates_start}</span> : use_dates_start} ~{' '}
|
|
|
|
|
{isNotEmpty(_changed.use_dates_end) ? <span className='t line-through '>{_changed.use_dates_end}</span> : use_dates_end}
|
|
|
|
|
</div>
|
|
|
|
|
) : null;
|
|
|
|
|
const editCls = colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? 'text-danger' : '';
|
|
|
|
|
const editCls = colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? 'text-danger' : '';
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{preValue}
|
|
|
|
@ -129,7 +130,7 @@ export const columnsSets = (t, colorize = true) => [
|
|
|
|
|
width: '6rem',
|
|
|
|
|
render: (text, { weekdays, audit_state_id, lastedit_changed }) => {
|
|
|
|
|
const _changed = parseJson(lastedit_changed);
|
|
|
|
|
const ifCompare = colorize && ![-1, 1, 2].includes(audit_state_id);
|
|
|
|
|
const ifCompare = colorize && !statesForHideEdited.includes(audit_state_id);
|
|
|
|
|
const ifData = !isEmpty((_changed.weekdayList || []).filter((s) => s));
|
|
|
|
|
const preValue = ifCompare && ifData ? <div className='text-muted line-through '>{_changed.weekdayList}</div> : null;
|
|
|
|
|
const editCls = ifCompare && ifData ? 'text-danger' : '';
|
|
|
|
|