Show card profile availability and order by priority
This commit is contained in:
parent
9a0ef19b12
commit
edb9fa9c9f
|
@ -3,6 +3,7 @@ const {
|
||||||
values,
|
values,
|
||||||
map,
|
map,
|
||||||
path,
|
path,
|
||||||
|
sortBy,
|
||||||
} = require('ramda');
|
} = require('ramda');
|
||||||
|
|
||||||
const r = require('r-dom');
|
const r = require('r-dom');
|
||||||
|
@ -50,9 +51,14 @@ const Preferences = withStateHandlers(
|
||||||
]),
|
]),
|
||||||
|
|
||||||
r(Select, {
|
r(Select, {
|
||||||
options: card.profiles,
|
options: sortBy(p => -p.priority, card.profiles),
|
||||||
optionValue: p => p.name,
|
optionValue: p => p.name,
|
||||||
optionText: p => p.description,
|
optionText: p => [
|
||||||
|
p.description,
|
||||||
|
!p.available && '(unavailable)',
|
||||||
|
]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(' '),
|
||||||
value: card.activeProfileName,
|
value: card.activeProfileName,
|
||||||
onChange: e => {
|
onChange: e => {
|
||||||
props.actions.setCardProfile(card.index, e.target.value);
|
props.actions.setCardProfile(card.index, e.target.value);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user