#116 - integration with slack #129

Merged
Baakoma merged 19 commits from #116-integration-with-slack into main 2022-04-27 09:57:13 +02:00
3 changed files with 9 additions and 9 deletions
Showing only changes of commit 4ecabeba0d - Show all commits

View File

@@ -33,13 +33,13 @@ class DailySummary extends SignatureHandler
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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?
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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?
->map(fn(User $user) => $user->profile->full_name);
$absencesAttachment = Attachment::create()
->setTitle("Nieobecności :palm_tree:")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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:")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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")
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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()
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:13:22 +02:00 (Migrated from github.com)
Review
        $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); ```
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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?
krzysztofrewak commented 2022-04-26 10:14:04 +02:00 (Migrated from github.com)
Review

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?

View File

@@ -43,7 +43,7 @@ class SendDailySummaryToSlack extends Command
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

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")
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

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")
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

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()
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:03 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-04-26 10:18:38 +02:00 (Migrated from github.com)
Review

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.

View File

@@ -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',
},
]