Commit 63b0cb2f authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

FEAT: implements all conflict resolution modes

parent 4682abaf
......@@ -337,12 +337,40 @@ export default {
},
resolveEvent (toResolve, mode) {
this.$log.debug('resolveEvent:', toResolve)
this.conflictCount -= toResolve.collisions.length
let slotIndex = this.calendarSlots.findIndex(s => s.id === toResolve.id)
switch (mode) {
case 'theirs':
this.conflictSolutions[toResolve.hash] = 'theirs'
this.calendarSlots[slotIndex].className = 'ours-discarded'
this.conflictSolutions[toResolve.hash] = mode
this.calendarSlots[slotIndex].className = 'timeslot-discarded'
for (let theirs of toResolve.collisions) {
this.calendarSlots.find(s => s.id === theirs.id).className = 'timeslot-accepted'
}
this.renderView(null)
break
case 'ours':
this.conflictSolutions[toResolve.hash] = mode
this.calendarSlots[slotIndex].className = 'timeslot-accepted'
for (let theirs of toResolve.collisions) {
this.calendarSlots.find(s => s.id === theirs.id).className = 'timeslot-discarded'
}
this.renderView(null)
break
case 'theirs-start':
case 'theirs-end':
case 'theirs-both':
case 'ours-start':
case 'ours-end':
case 'ours-both':
this.conflictSolutions[toResolve.hash] = mode
this.calendarSlots[slotIndex].className = 'timeslot-partly'
this.calendarSlots[slotIndex].title = 'new [' + mode + ']'
for (let theirs of toResolve.collisions) {
this.calendarSlots.find(s => s.id === theirs.id).className = 'timeslot-partly-theirs'
}
this.renderView(null)
break
......@@ -413,7 +441,6 @@ export default {
},
loadTimeslots (start, end) {
this.$log.debug('loadTimeslots: currentShow = '+this.currentShow)
this.loaded.timeslots = false
let uri = process.env.VUE_APP_API_STEERING + 'timeslots?start=' + start + '&end=' + end
axios.get(uri, {
......@@ -469,9 +496,21 @@ a.currentShow {
.noconflict {
background-color: #17a2b8;
}
.ours-discarded {
.timeslot-discarded {
background-color: #b00;
opacity: 0.5;
text-decoration: line-through !important;
}
.timeslot-accepted {
background-color: #17a2b8;
}
.timeslot-partly {
background-color: #17a2b8;
opacity: 0.5;
font-weight: bold;
}
.timeslot-partly-theirs {
background-color: #17a2b8;
opacity: 0.25;
}
</style>
......@@ -169,6 +169,7 @@ export default {
if (response.data.projected === undefined) {
this.$parent.renderView(null)
} else {
this.$log.debug('Timeslot conflict. Switching to resolve mode.')
this.$parent.resolve(response.data)
}
this.$refs.modalEmissionManagerCreate.hide()
......
......@@ -72,7 +72,7 @@
v-if="toResolve.solutionChoices.indexOf('theirs-start') >= 0"
variant="info"
size="sm"
@click="notYetImplemented"
@click="resolve('theirs-start')"
>
theirs-start<br>
TODO: describe
......@@ -82,7 +82,7 @@
v-if="toResolve.solutionChoices.indexOf('theirs-end') >= 0"
variant="info"
size="sm"
@click="notYetImplemented"
@click="resolve('theirs-end')"
>
theirs-end<br>
TODO: describe
......@@ -92,7 +92,7 @@
v-if="toResolve.solutionChoices.indexOf('theirs-both') >= 0"
variant="info"
size="sm"
@click="notYetImplemented"
@click="resolve('theirs-both')"
>
theirs-both<br>
TODO: describe
......@@ -102,7 +102,7 @@
v-if="toResolve.solutionChoices.indexOf('ours-start') >= 0"
variant="info"
size="sm"
@click="notYetImplemented"
@click="resolve('ours-start')"
>
ours-start<br>
TODO: describe
......@@ -112,7 +112,7 @@
v-if="toResolve.solutionChoices.indexOf('ours-end') >= 0"
variant="info"
size="sm"
@click="notYetImplemented"
@click="resolve('ours-end')"
>
ours-end<br>
TODO: describe
......@@ -122,7 +122,7 @@
v-if="toResolve.solutionChoices.indexOf('ours-both') >= 0"
variant="info"
size="sm"
@click="notYetImplemented"
@click="resolve('ours-both')"
>
ours-both<br>
TODO: describe
......@@ -159,6 +159,12 @@ export default {
switch (mode) {
case 'ours':
case 'theirs':
case 'theirs-start':
case 'theirs-end':
case 'theirs-both':
case 'ours-start':
case 'ours-end':
case 'ours-both':
this.$parent.resolveEvent(this.toResolve, mode)
this.$refs.modalEmissionManagerResolve.hide()
break
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment