Skip to content

Commit 8f98d58

Browse files
authored
feat: external color and label
1 parent dda8007 commit 8f98d58

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/Models/Place.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class Place
1212

1313
public $dueIn;
1414

15+
public $externalLabel;
16+
1517
public function __construct(string $label, string $name)
1618
{
1719
$this->label = $label;
@@ -23,24 +25,33 @@ public static function make(string $label, string $name)
2325
return new static($label,$name);
2426
}
2527

28+
public function externalLabel($externalLabel)
29+
{
30+
$this->externalLabel = $externalLabel;
31+
32+
return $this;
33+
}
34+
2635
public function dueIn($dueIn)
2736
{
2837
$this->dueIn = $dueIn;
38+
2939
return $this;
3040
}
3141

3242
public function color($color)
3343
{
3444
$this->color = $color;
45+
3546
return $this;
3647
}
3748

3849
public function toArray()
3950
{
4051
return [
4152
$this->name => [
42-
'metadata' => $this->metadata()
43-
]
53+
'metadata' => $this->metadata(),
54+
],
4455
];
4556
}
4657

@@ -49,7 +60,8 @@ public function metadata()
4960
return [
5061
'title' => $this->label,
5162
'color' => $this->color,
52-
'dueIn' => $this->dueIn
63+
'dueIn' => $this->dueIn,
64+
'externalLabel' => $this->externalLabel,
5365
];
5466
}
5567
}

src/Traits/HasWorkflow.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ public function getPlace($place)
146146
return [
147147
'name' => $place,
148148
'title' => $meta['title'],
149-
'color' => $meta['color']
149+
'color' => $meta['color'],
150+
'externalLabel' => $meta['externalLabel'] ?? $meta['title'],
151+
'externalColor' => $meta['externalColor'] ?? $meta['color'],
150152
];
151153
}
152154

0 commit comments

Comments
 (0)