From 84974a434c599ef1d17f2bbb115c0f3a7a47c8d2 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 8 Mar 2024 10:58:11 -0800 Subject: [PATCH] 2.0.1 - icons Fixes #34 --- CHANGELOG.md | 4 ++++ src/generators/FieldType.php | 1 + src/generators/Utility.php | 2 +- src/generators/WidgetType.php | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bde2078..4b0011a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Craft Generator +## 2.0.1 - 2024-03-08 +- Generated field types, utilities, and widget types now provide default icons. +- Fixed an error that occurred when generating a utility. ([#34](https://github.com/craftcms/generator/issues/34)) + ## 2.0.0 - 2024-03-06 - Craft Generator now requires Craft 5. - Renamed `craft\generator\Command\EVENT_REGISTER_GENERATOR_TYPES` to `EVENT_REGISTER_GENERATORS`. diff --git a/src/generators/FieldType.php b/src/generators/FieldType.php index e7bd557..a93c58e 100644 --- a/src/generators/FieldType.php +++ b/src/generators/FieldType.php @@ -153,6 +153,7 @@ private function methods(): array return [ 'displayName' => sprintf('return %s;', $this->messagePhp($this->displayName)), + 'icon' => 'return \'i-cursor\';', 'phpType' => "return 'mixed';", 'dbType' => << sprintf('return %s;', $this->messagePhp($this->displayName)), 'id' => "return '$this->utilityId';", - 'iconPath' => 'return null;', + 'icon' => 'return \'wrench\';', 'contentHtml' => << sprintf('return %s;', $this->messagePhp($this->displayName)), 'isSelectable' => 'return true;', - 'icon' => 'return null;', + 'icon' => 'return \'chart-line\';', 'getBodyHtml' => <<