IFTTT: card colors: add an actual white entry

To unset the color through the IFTTT, we need a white entry.
However, we do not want to show the white enry in the hamburger
`Set Color` entry.

We can also give the `white` capability to the API, it won't hurt
and be more straightforward.
This commit is contained in:
Benjamin Tissoires 2019-01-22 23:35:12 +01:00
parent 5769d438a0
commit 6e9bad5772
4 changed files with 19 additions and 8 deletions

View file

@ -339,9 +339,10 @@ template(name="cardMorePopup")
template(name="setCardColorPopup") template(name="setCardColorPopup")
form.edit-label form.edit-label
.palette-colors: each colors .palette-colors: each colors
span.card-label.palette-color.js-palette-color(class="card-details-{{color}}") unless $eq color 'white'
if(isSelected color) span.card-label.palette-color.js-palette-color(class="card-details-{{color}}")
i.fa.fa-check if(isSelected color)
i.fa.fa-check
button.primary.confirm.js-submit {{_ 'save'}} button.primary.confirm.js-submit {{_ 'save'}}
button.js-remove-color.negate.wide.right {{_ 'unset-color'}} button.js-remove-color.negate.wide.right {{_ 'unset-color'}}

View file

@ -601,6 +601,9 @@ BlazeComponent.extendComponent({
}, },
isSelected(color) { isSelected(color) {
if (this.currentColor.get() === null) {
return color === 'white';
}
return this.currentColor.get() === color; return this.currentColor.get() === color;
}, },

View file

@ -146,6 +146,10 @@ card-details-color(background, color...)
if color if color
color: color !important //overwrite text for better visibility color: color !important //overwrite text for better visibility
.card-details-white
card-details-color(unset, #000) //Black text for better visibility
border: 1px solid #eee
.card-details-green .card-details-green
card-details-color(#3cb500, #ffffff) //White text for better visibility card-details-color(#3cb500, #ffffff) //White text for better visibility

View file

@ -69,7 +69,7 @@ Cards.attachSchema(new SimpleSchema({
type: String, type: String,
optional: true, optional: true,
allowedValues: [ allowedValues: [
'green', 'yellow', 'orange', 'red', 'purple', 'white', 'green', 'yellow', 'orange', 'red', 'purple',
'blue', 'sky', 'lime', 'pink', 'black', 'blue', 'sky', 'lime', 'pink', 'black',
'silver', 'peachpuff', 'crimson', 'plum', 'darkgreen', 'silver', 'peachpuff', 'crimson', 'plum', 'darkgreen',
'slateblue', 'magenta', 'gold', 'navy', 'gray', 'slateblue', 'magenta', 'gold', 'navy', 'gray',
@ -1571,13 +1571,16 @@ if (Meteor.isServer) {
* *
* @description Edit a card * @description Edit a card
* *
* The color has to be chosen between `green`, `yellow`, `orange`, `red`, * The color has to be chosen between `white`, `green`, `yellow`, `orange`,
* `purple`, `blue`, `sky`, `lime`, `pink`, `black`, `silver`, `peachpuff`, * `red`, `purple`, `blue`, `sky`, `lime`, `pink`, `black`, `silver`,
* `crimson`, `plum`, `darkgreen`, `slateblue`, `magenta`, `gold`, `navy`, * `peachpuff`, `crimson`, `plum`, `darkgreen`, `slateblue`, `magenta`,
* `gray`, `saddlebrown`, `paleturquoise`, `mistyrose`, `indigo`: * `gold`, `navy`, `gray`, `saddlebrown`, `paleturquoise`, `mistyrose`,
* `indigo`:
* *
* <img src="/card-colors.png" width="40%" alt="Wekan card colors" /> * <img src="/card-colors.png" width="40%" alt="Wekan card colors" />
* *
* Note: setting the color to white has the same effect than removing it.
*
* @param {string} boardId the board ID of the card * @param {string} boardId the board ID of the card
* @param {string} list the list ID of the card * @param {string} list the list ID of the card
* @param {string} cardId the ID of the card * @param {string} cardId the ID of the card