#116 - integration with slack #129
@@ -33,13 +33,13 @@ class DailySummary extends SignatureHandler
|
||||
|
|
||||
->map(fn(User $user) => $user->profile->full_name);
|
||||
|
||||
$absencesAttachment = Attachment::create()
|
||||
->setTitle("Nieobecności :palm_tree:")
|
||||
```suggestion
$absences = $dailySummaryRetriever->getAbsences($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$remoteDays = $dailySummaryRetriever->getRemoteDays($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$birthdays = $dailySummaryRetriever->getBirthdays($now)
->map(fn(User $user): string => $user->profile->full_name);
```
What if we would have five more activities? Maybe this could be encapsulated somehow? What if we would have five more activities? Maybe this could be encapsulated somehow?
|
||||
->setTitle("Nieobecności :sunny:")
|
||||
```suggestion
$absences = $dailySummaryRetriever->getAbsences($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$remoteDays = $dailySummaryRetriever->getRemoteDays($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$birthdays = $dailySummaryRetriever->getBirthdays($now)
->map(fn(User $user): string => $user->profile->full_name);
```
What if we would have five more activities? Maybe this could be encapsulated somehow? What if we would have five more activities? Maybe this could be encapsulated somehow?
|
||||
->setColor("#eab308")
|
||||
->setText($absences->isNotEmpty() ? $absences->implode("\n") : "Wszyscy dzisiaj pracują :muscle:");
|
||||
|
||||
$remoteAttachment = Attachment::create()
|
||||
->setTitle("Praca zdalna :house_with_garden:")
|
||||
->setColor("#d946ef")
|
||||
```suggestion
$absences = $dailySummaryRetriever->getAbsences($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$remoteDays = $dailySummaryRetriever->getRemoteDays($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$birthdays = $dailySummaryRetriever->getBirthdays($now)
->map(fn(User $user): string => $user->profile->full_name);
```
What if we would have five more activities? Maybe this could be encapsulated somehow? What if we would have five more activities? Maybe this could be encapsulated somehow?
|
||||
->setColor("#527aba")
|
||||
```suggestion
$absences = $dailySummaryRetriever->getAbsences($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$remoteDays = $dailySummaryRetriever->getRemoteDays($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$birthdays = $dailySummaryRetriever->getBirthdays($now)
->map(fn(User $user): string => $user->profile->full_name);
```
What if we would have five more activities? Maybe this could be encapsulated somehow? What if we would have five more activities? Maybe this could be encapsulated somehow?
|
||||
->setText($remoteDays->isNotEmpty() ? $remoteDays->implode("\n") : "Wszyscy dzisiaj są w biurze :boom:");
|
||||
|
||||
$birthdayAttachment = Attachment::create()
|
||||
|
||||
```suggestion
$absences = $dailySummaryRetriever->getAbsences($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$remoteDays = $dailySummaryRetriever->getRemoteDays($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$birthdays = $dailySummaryRetriever->getBirthdays($now)
->map(fn(User $user): string => $user->profile->full_name);
```
```suggestion
$absences = $dailySummaryRetriever->getAbsences($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$remoteDays = $dailySummaryRetriever->getRemoteDays($now)
->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$birthdays = $dailySummaryRetriever->getBirthdays($now)
->map(fn(User $user): string => $user->profile->full_name);
```
What if we would have five more activities? Maybe this could be encapsulated somehow? What if we would have five more activities? Maybe this could be encapsulated somehow?
What if we would have five more activities? Maybe this could be encapsulated somehow? What if we would have five more activities? Maybe this could be encapsulated somehow?
|
||||
@@ -43,7 +43,7 @@ class SendDailySummaryToSlack extends Command
|
||||
|
These attachments are almost the same as somewhere above. There should be some abstraction for that. These attachments are almost the same as somewhere above. There should be some abstraction for that.
These attachments are almost the same as somewhere above. There should be some abstraction for that. These attachments are almost the same as somewhere above. There should be some abstraction for that.
I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it. I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it. I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
|
||||
|
||||
$remoteAttachment = Attachment::create()
|
||||
->setTitle("Praca zdalna :house_with_garden:")
|
||||
->setColor("#d946ef")
|
||||
|
These attachments are almost the same as somewhere above. There should be some abstraction for that. These attachments are almost the same as somewhere above. There should be some abstraction for that.
I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it. I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
|
||||
->setColor("#527aba")
|
||||
|
These attachments are almost the same as somewhere above. There should be some abstraction for that. These attachments are almost the same as somewhere above. There should be some abstraction for that.
I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it. I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
|
||||
->setText($remoteDays->isNotEmpty() ? $remoteDays->implode("\n") : "Wszyscy dzisiaj są w biurze :boom:");
|
||||
|
||||
$birthdayAttachment = Attachment::create()
|
||||
|
||||
|
These attachments are almost the same as somewhere above. There should be some abstraction for that. These attachments are almost the same as somewhere above. There should be some abstraction for that.
These attachments are almost the same as somewhere above. There should be some abstraction for that. These attachments are almost the same as somewhere above. There should be some abstraction for that.
I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it. I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it. I think I would prefer to use camelCased model attributes. It's not for this PR, but please think about it.
|
||||
@@ -8,7 +8,7 @@ import HandHeartOutlineIcon from 'vue-material-design-icons/HandHeartOutline.vue
|
||||
import CalendarCheckIcon from 'vue-material-design-icons/CalendarCheck.vue'
|
||||
import MedicalBagIcon from 'vue-material-design-icons/MedicalBag.vue'
|
||||
import CalendarRemoveIcon from 'vue-material-design-icons/CalendarRemove.vue'
|
||||
import LaptopIcon from 'vue-material-design-icons/Laptop.vue'
|
||||
import HomeCityIcon from 'vue-material-design-icons/HomeCity.vue'
|
||||
|
||||
const types = [
|
||||
{
|
||||
@@ -43,8 +43,8 @@ const types = [
|
||||
text: 'Urlop szkoleniowy',
|
||||
value: 'training_vacation',
|
||||
icon: HumanMaleBoardIcon,
|
||||
color: 'text-blumilk-500',
|
||||
border: 'border-blumilk-500',
|
||||
color: 'text-indigo-500',
|
||||
border: 'border-indigo-500',
|
||||
},
|
||||
{
|
||||
text: 'Urlop bezpłatny',
|
||||
@@ -84,9 +84,9 @@ const types = [
|
||||
{
|
||||
text: 'Praca zdalna',
|
||||
value: 'home_office',
|
||||
icon: LaptopIcon,
|
||||
color: 'text-fuchsia-500',
|
||||
border: 'border-fuchsia-500',
|
||||
icon: HomeCityIcon,
|
||||
color: 'text-blumilk-500',
|
||||
border: 'border-blumilk-500',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
What if we would have five more activities? Maybe this could be encapsulated somehow?
What if we would have five more activities? Maybe this could be encapsulated somehow?