mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
switched order of upper/lower bound in edit view
This commit is contained in:
committed by
Aaro Koivukangas
parent
8db68d2291
commit
ff3d81a9ff
@@ -38,6 +38,27 @@ export const TimeUnitTab = () => {
|
||||
],
|
||||
]
|
||||
|
||||
const up_id = editData.up_bound ? editData.up_bound.bid : data.up_bound ? data.up_bound.bid : ''
|
||||
const up_bname = editData.up_bound ? editData.up_bound.b_name : data.up_bound ? data.up_bound.b_name : ''
|
||||
const up_age = editData.up_bound ? editData.up_bound.age : data.up_bound ? data.up_bound.age : ''
|
||||
const up_bcomment = editData.up_bound ? editData.up_bound.b_comment : data.up_bound ? data.up_bound.b_comment : ''
|
||||
|
||||
const upBound = [
|
||||
[
|
||||
'Select New Upper Bound',
|
||||
<TimeBoundSelection<TimeBoundDetailsType, TimeUnitDetailsType>
|
||||
key="up_bnd"
|
||||
sourceField="bid"
|
||||
targetField="up_bnd"
|
||||
selectorTable={<TimeBoundTable showBid />}
|
||||
/>,
|
||||
],
|
||||
['Id', up_id],
|
||||
['Name', up_bname],
|
||||
['Age', up_age],
|
||||
['Comment', up_bcomment],
|
||||
]
|
||||
|
||||
const low_id = editData.low_bound ? editData.low_bound.bid : data.low_bound ? data.low_bound.bid : ''
|
||||
const low_bname = editData.low_bound ? editData.low_bound.b_name : data.low_bound ? data.low_bound.b_name : ''
|
||||
const low_age = editData.low_bound ? editData.low_bound.age : data.low_bound ? data.low_bound.age : ''
|
||||
@@ -63,54 +84,33 @@ export const TimeUnitTab = () => {
|
||||
['Comment', low_bcomment],
|
||||
]
|
||||
|
||||
const up_id = editData.up_bound ? editData.up_bound.bid : data.up_bound ? data.up_bound.bid : ''
|
||||
const up_bname = editData.up_bound ? editData.up_bound.b_name : data.up_bound ? data.up_bound.b_name : ''
|
||||
const up_age = editData.up_bound ? editData.up_bound.age : data.up_bound ? data.up_bound.age : ''
|
||||
const up_bcomment = editData.up_bound ? editData.up_bound.b_comment : data.up_bound ? data.up_bound.b_comment : ''
|
||||
|
||||
const upBound = [
|
||||
[
|
||||
'Select New Upper Bound',
|
||||
<TimeBoundSelection<TimeBoundDetailsType, TimeUnitDetailsType>
|
||||
key="up_bnd"
|
||||
sourceField="bid"
|
||||
targetField="up_bnd"
|
||||
selectorTable={<TimeBoundTable showBid />}
|
||||
/>,
|
||||
],
|
||||
['Id', up_id],
|
||||
['Name', up_bname],
|
||||
['Age', up_age],
|
||||
['Comment', up_bcomment],
|
||||
]
|
||||
|
||||
let lowerBoundTitle: string
|
||||
let upperBoundTitle: string
|
||||
if (!editData.low_bound || !data.low_bound) {
|
||||
lowerBoundTitle = 'Lower bound'
|
||||
} else {
|
||||
lowerBoundTitle = editData.low_bound.bid === data.low_bound.bid ? 'Lower bound' : 'Lower bound (edited)'
|
||||
}
|
||||
let lowerBoundTitle: string
|
||||
if (!editData.up_bound || !data.up_bound) {
|
||||
upperBoundTitle = 'Upper bound'
|
||||
} else {
|
||||
upperBoundTitle = editData.up_bound.bid === data.up_bound.bid ? 'Upper bound' : 'Upper bound (edited)'
|
||||
}
|
||||
if (!editData.low_bound || !data.low_bound) {
|
||||
lowerBoundTitle = 'Lower bound'
|
||||
} else {
|
||||
lowerBoundTitle = editData.low_bound.bid === data.low_bound.bid ? 'Lower bound' : 'Lower bound (edited)'
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ArrayFrame array={timeUnit} title="Time Unit" />
|
||||
<>
|
||||
<ArrayFrame
|
||||
array={lowBound}
|
||||
title={lowerBoundTitle}
|
||||
highlighted={lowerBoundTitle === 'Lower bound (edited)' ? true : false}
|
||||
/>
|
||||
<ArrayFrame
|
||||
array={upBound}
|
||||
title={upperBoundTitle}
|
||||
highlighted={upperBoundTitle === 'Upper bound (edited)' ? true : false}
|
||||
/>
|
||||
<ArrayFrame
|
||||
array={lowBound}
|
||||
title={lowerBoundTitle}
|
||||
highlighted={lowerBoundTitle === 'Lower bound (edited)' ? true : false}
|
||||
/>
|
||||
</>
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user