Parlellsession- Plan #35
|
|
@ -1173,8 +1173,28 @@ export default function TrainingUnitSectionsEditor({
|
||||||
enableParallelPhaseControls &&
|
enableParallelPhaseControls &&
|
||||||
pl?.phaseKind === 'parallel' &&
|
pl?.phaseKind === 'parallel' &&
|
||||||
(pl.parallelStreamOrderIndex ?? 0) !== activeParallelStream
|
(pl.parallelStreamOrderIndex ?? 0) !== activeParallelStream
|
||||||
|
const firstGlobalIdxThisPhase =
|
||||||
|
parallelPhaseOrder != null
|
||||||
|
? firstSectionIndexByParallelPhase.get(parallelPhaseOrder)
|
||||||
|
: null
|
||||||
|
const firstVisibleIdxActiveStream =
|
||||||
|
parallelPhaseOrder != null && streamOrdersForParallelPhase.length
|
||||||
|
? sectionIndicesForParallelStream(
|
||||||
|
list,
|
||||||
|
parallelPhaseOrder,
|
||||||
|
activeParallelStream
|
||||||
|
)[0]
|
||||||
|
: null
|
||||||
|
const hideDropBandBeforeOrphanFirstVisible =
|
||||||
|
parallelPhaseOrder != null &&
|
||||||
|
firstVisibleIdxActiveStream != null &&
|
||||||
|
sIdx === firstVisibleIdxActiveStream &&
|
||||||
|
firstGlobalIdxThisPhase != null &&
|
||||||
|
sIdx !== firstGlobalIdxThisPhase
|
||||||
|
|
||||||
const showSectionDropBandBefore =
|
const showSectionDropBandBefore =
|
||||||
pl?.phaseKind !== 'parallel' || !hideParallelSection
|
(pl?.phaseKind !== 'parallel' || !hideParallelSection) &&
|
||||||
|
!hideDropBandBeforeOrphanFirstVisible
|
||||||
|
|
||||||
const bandActiveBefore = (bx) =>
|
const bandActiveBefore = (bx) =>
|
||||||
enableSectionDragReorder &&
|
enableSectionDragReorder &&
|
||||||
|
|
|
||||||
|
|
@ -814,7 +814,19 @@ export function reorderBlocksImmutableWithPlanLoc(prev, fromI, toBeforeIdx) {
|
||||||
const above = insertAt > 0 ? arr[insertAt - 1] : undefined
|
const above = insertAt > 0 ? arr[insertAt - 1] : undefined
|
||||||
|
|
||||||
let planLocNext = null
|
let planLocNext = null
|
||||||
if (below?.planLoc?.phaseKind) {
|
const belowKind = below?.planLoc?.phaseKind
|
||||||
|
const aboveKind = above?.planLoc?.phaseKind
|
||||||
|
|
||||||
|
if (
|
||||||
|
belowKind === 'parallel' &&
|
||||||
|
(!above || aboveKind === 'whole_group')
|
||||||
|
) {
|
||||||
|
if (aboveKind === 'whole_group') {
|
||||||
|
planLocNext = { ...above.planLoc }
|
||||||
|
} else {
|
||||||
|
planLocNext = defaultPlanLocWholeGroup(0)
|
||||||
|
}
|
||||||
|
} else if (belowKind) {
|
||||||
planLocNext = { ...below.planLoc }
|
planLocNext = { ...below.planLoc }
|
||||||
} else if (insertAt === arr.length) {
|
} else if (insertAt === arr.length) {
|
||||||
if (!above) {
|
if (!above) {
|
||||||
|
|
@ -875,7 +887,6 @@ export function reorderBlockIntoParallelStreamEnd(prev, fromI, phaseOrderIndex,
|
||||||
insertAt = phaseIdx[phaseIdx.length - 1] + 1
|
insertAt = phaseIdx[phaseIdx.length - 1] + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fromI < insertAt) insertAt -= 1
|
|
||||||
insertAt = Math.max(0, Math.min(insertAt, arr.length))
|
insertAt = Math.max(0, Math.min(insertAt, arr.length))
|
||||||
arr.splice(insertAt, 0, { ...moved, planLoc: { ...planLocTemplate } })
|
arr.splice(insertAt, 0, { ...moved, planLoc: { ...planLocTemplate } })
|
||||||
return arr
|
return arr
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user