From b8c1ec8cb95a6c72dde779eea9b4ed678f2f6de8 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Tue, 19 May 2026 14:55:10 -0400 Subject: [PATCH 01/12] wip --- lang/en/messages.php | 10 + .../dashboard/WidgetConfigStack.vue | 78 ++++++ .../js/components/dashboard/WidgetPicker.vue | 41 +++ .../js/components/dashboard/WidgetTile.vue | 48 ++++ resources/js/pages/Dashboard.vue | 247 +++++++++++++++--- routes/cp.php | 4 + src/Forms/Widget.php | 69 +++++ .../Controllers/CP/DashboardController.php | 50 +++- .../CP/DashboardWidgetsController.php | 72 +++++ src/Widgets/Collection.php | 80 ++++++ src/Widgets/Template.php | 40 +++ src/Widgets/Updater.php | 12 + src/Widgets/Widget.php | 71 +++-- .../CP/DashboardWidgetsControllerTest.php | 123 +++++++++ 14 files changed, 880 insertions(+), 65 deletions(-) create mode 100644 resources/js/components/dashboard/WidgetConfigStack.vue create mode 100644 resources/js/components/dashboard/WidgetPicker.vue create mode 100644 resources/js/components/dashboard/WidgetTile.vue create mode 100644 src/Http/Controllers/CP/DashboardWidgetsController.php create mode 100644 tests/Feature/CP/DashboardWidgetsControllerTest.php diff --git a/lang/en/messages.php b/lang/en/messages.php index f5e7e230fb7..4b2008fcf65 100644 --- a/lang/en/messages.php +++ b/lang/en/messages.php @@ -291,5 +291,15 @@ 'user_wizard_invitation_subject' => 'Activate your new Statamic account on :site', 'user_wizard_roles_groups_intro' => 'Users can be assigned to roles that customize their permissions, access, and abilities throughout the Control Panel.', 'user_wizard_super_admin_instructions' => 'Super admins have complete control and access to everything in the control panel. Grant this role wisely.', + 'widget_classes_instructions' => 'Additional CSS classes applied to the widget wrapper.', + 'widget_collection_description' => 'Shows recent entries from a collection.', + 'widget_collection_fields_instructions' => 'Field handles to display as columns. Defaults to title.', + 'widget_collection_order_by_instructions' => 'Field and direction, e.g. date:desc or title:asc.', + 'widget_collection_title_instructions' => 'Override the widget title. Defaults to the collection title.', + 'widget_form_description' => 'Shows recent submissions for a form.', + 'widget_form_form_instructions' => 'The handle of the form to display submissions for.', + 'widget_template_description' => 'Renders a custom Blade or Antlers template.', + 'widget_template_template_instructions' => 'Path to the template, relative to the views directory.', + 'widget_updater_description' => 'Shows available updates for Statamic and your installed addons.', 'width_x_height' => ':width × :height', ]; diff --git a/resources/js/components/dashboard/WidgetConfigStack.vue b/resources/js/components/dashboard/WidgetConfigStack.vue new file mode 100644 index 00000000000..d3ba5225a65 --- /dev/null +++ b/resources/js/components/dashboard/WidgetConfigStack.vue @@ -0,0 +1,78 @@ + + + diff --git a/resources/js/components/dashboard/WidgetPicker.vue b/resources/js/components/dashboard/WidgetPicker.vue new file mode 100644 index 00000000000..1cbc3be9c23 --- /dev/null +++ b/resources/js/components/dashboard/WidgetPicker.vue @@ -0,0 +1,41 @@ + + + diff --git a/resources/js/components/dashboard/WidgetTile.vue b/resources/js/components/dashboard/WidgetTile.vue new file mode 100644 index 00000000000..73e4b7f049d --- /dev/null +++ b/resources/js/components/dashboard/WidgetTile.vue @@ -0,0 +1,48 @@ + + + diff --git a/resources/js/pages/Dashboard.vue b/resources/js/pages/Dashboard.vue index 57d1d9cb1ab..04cdac67c9e 100644 --- a/resources/js/pages/Dashboard.vue +++ b/resources/js/pages/Dashboard.vue @@ -1,52 +1,216 @@ -