UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

20 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const selectors_1 = require("../../jobs/selectors"); const data_1 = require("../../frequencies/data"); exports.canAllocate = (state) => ['live', 'allocated'].indexOf(selectors_1.getJobPage(state)) !== -1 && state.frequencies.flags.selectedFrequencyType !== data_1.FREQUENCY_TYPE_AUTO; // todo - selector exports.isDropTarget = (state, type, refId) => { const { drag, drop } = state.allocation.dragging; //console.log('isDropTarget', type, refId, drop) return type === drop.type && refId === drop.refId && drag.type !== drop.type; // you can't drop a job on a job }; exports.canAllocateJob = (job) => // if it's never been allocated OR if it can still be reallocated job.status === 'live' || exports.canDeallocateJob(job); exports.canDeallocateJob = (job) => // it must be allocated and not yet accepted job.status === 'allocated' && job.lastAction !== 'accepted'; //# sourceMappingURL=allocation.js.map