#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
4 changed files with 4 additions and 4 deletions
Showing only changes of commit ae1f6e066b - Show all commits

View File

@@ -44,7 +44,7 @@ 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?
$birthdayAttachment = Attachment::create()
->setTitle("Urodziny :birthday:")
->setColor("#3C5F97")
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("#3c5f97")
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($birthdays->isNotEmpty() ? $birthdays->implode("\n") : "Dzisiaj nikt nie ma urodzin :cry:");
return $this->respondToSlack("Podsumowanie dla dnia {$now->toDisplayString()}")
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

@@ -24,7 +24,7 @@ class KeyList extends SignatureHandler
return $this->respondToSlack("Lista kluczy :key:")
->withAttachment(
Attachment::create()
->setColor("#3C5F97")
->setColor("#3c5f97")
->setText($keys->isNotEmpty() ? $keys->implode("\n") : "Nie ma żadnych kluczy w tobym"),
);
}

View File

@@ -48,7 +48,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.
$birthdayAttachment = Attachment::create()
->setTitle("Urodziny :birthday:")
->setColor("#3C5F97")
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("#3c5f97")
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($birthdays->isNotEmpty() ? $birthdays->implode("\n") : "Dzisiaj nikt nie ma urodzin :cry:");
$baseUrl = config("services.slack.url");
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

@@ -56,7 +56,7 @@
"All rights reserved.": "Wszelkie prawa zastrzeżone",
"Show vacation request": "Pokaż wniosek",
"Vacation request :title has been created" : "Wniosek :title został utworzony",
"The vacation request :title from user :requester has been created sucessfully.": "Wniosek :title użytkownika :requester został utworzony pomyślnie.",
"The vacation request :title from user :requester has been created successfully.": "Wniosek :title użytkownika :requester został utworzony pomyślnie.",
"Vacation type: :type": "Rodzaj wniosku: :type",
"From :from to :to (number of days: :days)": "Od :from do :to (liczba dni: :days)",
"Click here for details": "Kliknij, aby zobaczyć szczegóły",