Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions database/factories/IncidentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ public function definition(): array
];
}

/**
* Schedule the incident to publish in the future, hiding it from public surfaces until then.
*/
public function scheduled(): self
{
return $this->state(['published_at' => now()->addDays(7)]);
}

/**
* Mark the incident as already published.
*/
public function published(): self
{
return $this->state(['published_at' => now()->subDay()]);
}

/**
* Provide the incident with additional meta.
*/
Expand Down
16 changes: 16 additions & 0 deletions database/factories/ScheduleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ public function definition(): array
];
}

/**
* Schedule the maintenance to publish in the future, hiding it from public surfaces until then.
*/
public function scheduled(): self
{
return $this->state(['published_at' => now()->addDays(3)]);
}

/**
* Mark the maintenance as already published.
*/
public function published(): self
{
return $this->state(['published_at' => now()->subDay()]);
}

public function completed(): self
{
return $this->state([
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('incidents', function (Blueprint $table) {
$table->timestamp('published_at')->nullable();
$table->timestamp('published_notified_at')->nullable();
});

Schema::table('schedules', function (Blueprint $table) {
$table->timestamp('published_at')->nullable();
$table->timestamp('published_notified_at')->nullable();
});

// Existing incidents and schedules were published the moment they were
// created, so treat their publish timestamp as their creation time.
// published_notified_at is backfilled in lockstep so the publish
// notification command never re-announces historical records.
foreach (['incidents', 'schedules'] as $table) {
DB::table($table)->whereNull('published_at')->update([
'published_at' => DB::raw('created_at'),
'published_notified_at' => DB::raw('created_at'),
]);
}
}
};
7 changes: 7 additions & 0 deletions resources/lang/de/incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
'visible' => 'Sichtbar',
'stickied' => 'Angeheftet',
'occurred_at' => 'Aufgetreten am',
'published_at' => 'Veröffentlicht am',
'notified_subscribers' => 'Benachrichtigte Abonnenten',
'created_at' => 'Erstellt am',
'updated_at' => 'Aktualisiert am',
'deleted_at' => 'Gelöscht am',
],
'published_now' => 'Veröffentlicht',
'filters' => [
'scheduled' => 'Geplant (noch nicht veröffentlicht)',
],
'actions' => [
'record_update' => 'Update aufzeichnen',
'view_incident' => 'Vorfall anschauen',
Expand All @@ -52,6 +57,8 @@
'message_label' => 'Nachricht',
'occurred_at_label' => 'Aufgetreten am',
'occurred_at_helper' => 'Wenn dieses Feld leer gelassen wird, wird der Zeitstempel der Erstellung des Vorfalls verwendet.',
'published_at_label' => 'Veröffentlicht am',
'published_at_helper' => 'Plane den Vorfall so, dass er zu einem späteren Zeitpunkt auf der Statusseite erscheint. Bis dahin für alle verborgen. Leer lassen, um sofort zu veröffentlichen.',
'visible_label' => 'Sichtbar',
'user_label' => 'Benutzer',
'user_helper' => 'Benutzer, welcher den Vorfall gemeldet hat.',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/de/schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
'status' => 'Status',
'scheduled_at' => 'Terminiert für',
'completed_at' => 'Abgeschlossen am',
'published_at' => 'Veröffentlicht am',
'created_at' => 'Erstellt am',
'updated_at' => 'Aktualisiert am',
'deleted_at' => 'Gelöscht am',
],
'published_now' => 'Veröffentlicht',
'filters' => [
'scheduled' => 'Geplant (noch nicht veröffentlicht)',
],
'empty_state' => [
'heading' => 'Zeitpläne',
'description' => 'Plane und terminiere deine Wartungen.',
Expand All @@ -26,6 +31,8 @@
'message_label' => 'Nachricht',
'scheduled_at_label' => 'Beginn',
'completed_at_label' => 'Ende',
'published_at_label' => 'Veröffentlicht am',
'published_at_helper' => 'Plane die Wartung so, dass sie zu einem späteren Zeitpunkt auf der Statusseite erscheint. Bis dahin für alle verborgen. Leer lassen, um sofort zu veröffentlichen.',
],
'add_update' => [
'success_title' => 'Zeitplan aktualisiert - :name',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/de_AT/incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
'visible' => 'Sichtbar',
'stickied' => 'Angeheftet',
'occurred_at' => 'Aufgetreten am',
'published_at' => 'Veröffentlicht am',
'notified_subscribers' => 'Benachrichtigte Abonnenten',
'created_at' => 'Erstellt am',
'updated_at' => 'Aktualisiert am',
'deleted_at' => 'Gelöscht am',
],
'published_now' => 'Veröffentlicht',
'filters' => [
'scheduled' => 'Geplant (noch nicht veröffentlicht)',
],
'actions' => [
'record_update' => 'Update aufzeichnen',
'view_incident' => 'Vorfall anschauen',
Expand All @@ -52,6 +57,8 @@
'message_label' => 'Nachricht',
'occurred_at_label' => 'Aufgetreten am',
'occurred_at_helper' => 'Wenn dieses Feld leer gelassen wird, wird der Zeitstempel der Erstellung des Vorfalls verwendet.',
'published_at_label' => 'Veröffentlicht am',
'published_at_helper' => 'Plane den Vorfall so, dass er zu einem zukünftigen Zeitpunkt auf der Statusseite erscheint. Bis dahin für alle ausgeblendet. Leer lassen, um sofort zu veröffentlichen.',
'visible_label' => 'Sichtbar',
'user_label' => 'Benutzer',
'user_helper' => 'Benutzer, welcher den Vorfall gemeldet hat.',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/de_AT/schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
'status' => 'Status',
'scheduled_at' => 'Terminiert für',
'completed_at' => 'Abgeschlossen am',
'published_at' => 'Veröffentlicht am',
'created_at' => 'Erstellt am',
'updated_at' => 'Aktualisiert am',
'deleted_at' => 'Gelöscht am',
],
'published_now' => 'Veröffentlicht',
'filters' => [
'scheduled' => 'Geplant (noch nicht veröffentlicht)',
],
'empty_state' => [
'heading' => 'Zeitpläne',
'description' => 'Plane und terminiere deine Wartungen.',
Expand All @@ -26,6 +31,8 @@
'message_label' => 'Nachricht',
'scheduled_at_label' => 'Beginn',
'completed_at_label' => 'Ende',
'published_at_label' => 'Veröffentlicht am',
'published_at_helper' => 'Plane die Wartung so, dass sie zu einem zukünftigen Zeitpunkt auf der Statusseite erscheint. Bis dahin für alle ausgeblendet. Leer lassen, um sofort zu veröffentlichen.',
],
'add_update' => [
'success_title' => 'Zeitplan aktualisiert - :name',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/de_CH/incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
'visible' => 'Sichtbar',
'stickied' => 'Angeheftet',
'occurred_at' => 'Aufgetreten am',
'published_at' => 'Veröffentlicht am',
'notified_subscribers' => 'Benachrichtigte Abonnenten',
'created_at' => 'Erstellt am',
'updated_at' => 'Aktualisiert am',
'deleted_at' => 'Gelöscht am',
],
'published_now' => 'Veröffentlicht',
'filters' => [
'scheduled' => 'Geplant (noch nicht veröffentlicht)',
],
'actions' => [
'record_update' => 'Update aufzeichnen',
'view_incident' => 'Vorfall anschauen',
Expand All @@ -52,6 +57,8 @@
'message_label' => 'Nachricht',
'occurred_at_label' => 'Aufgetreten am',
'occurred_at_helper' => 'Wenn dieses Feld leer gelassen wird, wird der Zeitstempel der Erstellung des Vorfalls verwendet.',
'published_at_label' => 'Veröffentlicht am',
'published_at_helper' => 'Plane den Vorfall so, dass er zu einem späteren Zeitpunkt auf der Statusseite erscheint. Bis dahin für alle verborgen. Leer lassen, um sofort zu veröffentlichen.',
'visible_label' => 'Sichtbar',
'user_label' => 'Benutzer',
'user_helper' => 'Benutzer, welcher den Vorfall gemeldet hat.',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/de_CH/schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
'status' => 'Status',
'scheduled_at' => 'Terminiert für',
'completed_at' => 'Abgeschlossen am',
'published_at' => 'Veröffentlicht am',
'created_at' => 'Erstellt am',
'updated_at' => 'Aktualisiert am',
'deleted_at' => 'Gelöscht am',
],
'published_now' => 'Veröffentlicht',
'filters' => [
'scheduled' => 'Geplant (noch nicht veröffentlicht)',
],
'empty_state' => [
'heading' => 'Zeitpläne',
'description' => 'Plane und terminiere deine Wartungen.',
Expand All @@ -26,6 +31,8 @@
'message_label' => 'Nachricht',
'scheduled_at_label' => 'Beginn',
'completed_at_label' => 'Ende',
'published_at_label' => 'Veröffentlicht am',
'published_at_helper' => 'Plane die Wartung so, dass sie zu einem späteren Zeitpunkt auf der Statusseite erscheint. Bis dahin für alle verborgen. Leer lassen, um sofort zu veröffentlichen.',
],
'add_update' => [
'success_title' => 'Zeitplan aktualisiert - :name',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/en/incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
'visible' => 'Visible',
'stickied' => 'Stickied',
'occurred_at' => 'Occurred at',
'published_at' => 'Published at',
'notified_subscribers' => 'Notified subscribers',
'created_at' => 'Created at',
'updated_at' => 'Updated at',
'deleted_at' => 'Deleted at',
],
'published_now' => 'Published',
'filters' => [
'scheduled' => 'Scheduled (not yet published)',
],
'actions' => [
'record_update' => 'Record update',
'view_incident' => 'View incident',
Expand All @@ -52,6 +57,8 @@
'message_label' => 'Message',
'occurred_at_label' => 'Occurred at',
'occurred_at_helper' => 'The incident\'s created timestamp will be used if left empty.',
'published_at_label' => 'Published at',
'published_at_helper' => 'Schedule the incident to appear on the status page at a future date. Hidden from everyone until then. Leave empty to publish immediately.',
'visible_label' => 'Visible',
'user_label' => 'User',
'user_helper' => 'The user who reported the incident.',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/en/schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
'status' => 'Status',
'scheduled_at' => 'Scheduled at',
'completed_at' => 'Completed at',
'published_at' => 'Published at',
'created_at' => 'Created at',
'updated_at' => 'Updated at',
'deleted_at' => 'Deleted at',
],
'published_now' => 'Published',
'filters' => [
'scheduled' => 'Scheduled (not yet published)',
],
'empty_state' => [
'heading' => 'Schedules',
'description' => 'Plan and schedule your maintenance.',
Expand All @@ -28,6 +33,8 @@
'scheduled_at_helper' => 'When the maintenance window begins.',
'completed_at_label' => 'Completed at',
'completed_at_helper' => 'When the maintenance window is expected to end.',
'published_at_label' => 'Published at',
'published_at_helper' => 'Schedule the maintenance to appear on the status page at a future date. Hidden from everyone until then. Leave empty to publish immediately.',
'notify_subscribers_label' => 'Notify subscribers of this maintenance.',
'notifications_helper' => 'Email subscribers about this scheduled maintenance and its updates.',
'meta_label' => 'Meta',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/es_ES/incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
'visible' => 'Visible',
'stickied' => 'Fijado',
'occurred_at' => 'Ocurrido el',
'published_at' => 'Publicado el',
'notified_subscribers' => 'Suscriptores notificados',
'created_at' => 'Creado el',
'updated_at' => 'Actualizado el',
'deleted_at' => 'Eliminado el',
],
'published_now' => 'Publicado',
'filters' => [
'scheduled' => 'Programado (aún no publicado)',
],
'actions' => [
'record_update' => 'Registrar actualización',
'view_incident' => 'Ver incidente',
Expand All @@ -52,6 +57,8 @@
'message_label' => 'Mensaje',
'occurred_at_label' => 'Ocurrido el',
'occurred_at_helper' => 'Se usará la fecha de creación del incidente si se deja vacío.',
'published_at_label' => 'Publicado el',
'published_at_helper' => 'Programa el incidente para que aparezca en la página de estado en una fecha futura. Oculto para todos hasta entonces. Deja vacío para publicar inmediatamente.',
'visible_label' => 'Visible',
'user_label' => 'Usuario',
'user_helper' => 'El usuario que reportó el incidente.',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/es_ES/schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
'status' => 'Estado',
'scheduled_at' => 'Programado para',
'completed_at' => 'Completado en',
'published_at' => 'Publicado el',
'created_at' => 'Creado el',
'updated_at' => 'Actualizado el',
'deleted_at' => 'Eliminado el',
],
'published_now' => 'Publicado',
'filters' => [
'scheduled' => 'Programado (aún no publicado)',
],
'empty_state' => [
'heading' => 'Horarios',
'description' => 'Planifica y programa tu mantenimiento.',
Expand All @@ -26,6 +31,8 @@
'message_label' => 'Mensaje',
'scheduled_at_label' => 'Programado para',
'completed_at_label' => 'Completado en',
'published_at_label' => 'Publicado el',
'published_at_helper' => 'Programa el mantenimiento para que aparezca en la página de estado en una fecha futura. Oculto para todos hasta entonces. Deja vacío para publicar inmediatamente.',
],
'add_update' => [
'success_title' => 'Horario :name Actualizado',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/fr/incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
'visible' => 'Visible',
'stickied' => 'Épinglé',
'occurred_at' => 'Survenu le',
'published_at' => 'Publié le',
'notified_subscribers' => 'Abonnés notifiés',
'created_at' => 'Créé le',
'updated_at' => 'Mis à jour le',
'deleted_at' => 'Supprimé le',
],
'published_now' => 'Publié',
'filters' => [
'scheduled' => 'Programmé (pas encore publié)',
],
'actions' => [
'record_update' => 'Enregistrer une mise à jour',
'view_incident' => 'Voir l’incident',
Expand All @@ -52,6 +57,8 @@
'message_label' => 'Message',
'occurred_at_label' => 'Survenu le',
'occurred_at_helper' => 'L’horodatage de création de l’incident sera utilisé si laissé vide.',
'published_at_label' => 'Publié le',
'published_at_helper' => 'Programmez l’incident pour qu’il apparaisse sur la page d’état à une date future. Masqué à tous jusqu’à cette date. Laissez vide pour publier immédiatement.',
'visible_label' => 'Visible',
'user_label' => 'Utilisateur',
'user_helper' => 'L’utilisateur ayant signalé l’incident.',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/fr/schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
'status' => 'Statut',
'scheduled_at' => 'Planifié le',
'completed_at' => 'Terminé le',
'published_at' => 'Publié le',
'created_at' => 'Créé le',
'updated_at' => 'Mis à jour le',
'deleted_at' => 'Supprimé le',
],
'published_now' => 'Publié',
'filters' => [
'scheduled' => 'Programmé (pas encore publié)',
],
'empty_state' => [
'heading' => 'Planifications',
'description' => 'Planifiez et programmez votre maintenance.',
Expand All @@ -26,6 +31,8 @@
'message_label' => 'Message',
'scheduled_at_label' => 'Planifié le',
'completed_at_label' => 'Terminé le',
'published_at_label' => 'Publié le',
'published_at_helper' => 'Programmez la maintenance pour qu’elle apparaisse sur la page d’état à une date future. Masquée à tous jusqu’à cette date. Laissez vide pour publier immédiatement.',
],
'add_update' => [
'success_title' => 'Planification :name mise à jour',
Expand Down
Loading
Loading